-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
JS Heap grows when using subscriptions #6880
Comments
Hey @brainkim, any news about this issue? In our project, we've experienced the same problem. |
Experiencing the same exact thing on React Native, very severely |
I just did a 7 minute-sampling with the example given (but an update every 10ms, not 500, so I'd expect to see it even more), but I'm not seeing a significant heap size increase. @H-a-w-k, @michal-damiecki, could you give a bit more context on the environments where you were experiencing these issues? |
Since there hasn't been any more feedback for half a year and we cannot reproduce it ourselves, I'm closing the issue. At the same time I want to bring it to your attention that the upcoming version 3.9 (out in beta right now) will contain a lot of memory fixes: See the announcement blog post. If this comes up again (and has not been fixed by 3.9), please open a new issue with a new reproduction. Thank you! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Intended outcome:
When I subscribe, I expect the memory to stay somewhat constant, since the subscription only updates data, and does not add more elements.
Actual outcome:
As soon as I use useSubscription or subscribeToMore the js heap starts building up.
When using the apollo dev tools, I can see that the cache is not growing, and it behaves as expected.
It's like the garbage collector doesn't get everything, and somewhere a the subscribed data is persisted.
This simple subscription causes the problem. To get a bigger leak, I've added a picture where I have used the subscription many times.
A repo with the test files can be found here:
https://github.com/H-a-w-k/apollo-subscription-heap-growing
Client code:
Server code:
How to reproduce the issue:
Use the repo with the test files can be found here:
https://github.com/H-a-w-k/apollo-subscription-heap-growing
or just copy paste the code above and install necessary dependencies.
Just start the client and server and start viewing the result in task manager and profiler
The text was updated successfully, but these errors were encountered: