Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sending SDK to createInstance() in Server-side context causes memory leaks #891

Open
1 task done
dbridenbeck opened this issue Jan 17, 2024 · 2 comments
Open
1 task done

Comments

@dbridenbeck
Copy link

dbridenbeck commented Jan 17, 2024

Is there an existing issue for this?

  • I have searched the existing issues

SDK Version

4.9.2

Current Behavior

When passing the SDK key into createInstance we saw memory leaks happening. In the react-sdk it's advised not to pass the SDK key in, and I think that the javascript-sdk documentation should be updated to provide a similar warning for the section in node.js.

Current documentation: https://github.com/optimizely/javascript-sdk?tab=readme-ov-file#use-the-javascript-sdk-node
image

Expected Behavior

Expected documentation is to be a-la react-sdk: https://github.com/optimizely/react-sdk?tab=readme-ov-file#server-side-rendering

image

Steps To Reproduce

  1. In a server environment, pass SDK instead of datafile into createInstance(), deploy
  2. Use k6 or some other way to pass large traffic to the deployed environment
  3. Observe containers running out of memory and restarting

SDK Type

Browser

Node Version

16.10.0

Browsers impacted

n/a

Link

No response

Logs

No response

Severity

Minor issue

Workaround/Solution

Pass dataFile instead of SDK into createInstance()

Recent Change

Not certain.

Conflicts

Not likely, although we are on next 12.

@raju-opti
Copy link
Contributor

raju-opti commented Jan 19, 2024

@dbridenbeck , yes, for server side rendering, Javascript sdk should have similar restrictions as react sdk. We will look into this a bit further and update this issue accordingly.

@mikechu-optimizely
Copy link
Contributor

We released version v5.3.0. Can you review this version in an SSR test environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants