This repository was archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 774
This repository was archived by the owner on Apr 13, 2023. It is now read-only.
Memory leak in renderToStringWithData #2126
Copy link
Copy link
Open
Labels
blockingPrevents production or dev due to perf, bug, build error, etc..Prevents production or dev due to perf, bug, build error, etc..has-reproduction❤ Has a reproduction in a codesandbox or single minimal repository❤ Has a reproduction in a codesandbox or single minimal repository
Description
Intended outcome:
I have a service which uses the renderToStringWithData function from react-apollo. I expect the function to not have any memory leaks.
Actual outcome:
The service crashes every now and then, because it runs out of memory. I read a tutorial on how to diagnose memory leaks and I think I found one that is caused by the mentioned function. I have the same issue with another node app which uses renderToStringWithData.
This graph shows the growing memory consumption of my reproduction with GitHunt:

How to reproduce the issue:
- Clone https://github.com/amannn/GitHunt-React
- Make sure you're on the
memory-profilingbranch. - Do the regular GitHunt setup.
yarn buildyarn startab -n 100 http://127.0.0.1:3000/(sends a request to the server 100 times)- When the requests are through, stop the server. This will cause the profiling data to be written to
stats.json. - Run
python plot.pyto see the graph.
The mentioned tutorial also outlines a method for getting more information about which objects are allocated and never released by garbage collection.
Version
- apollo-client@2.3.5
- react-apollo@2.1.6
mike-marcacci, bjacobel, msparer, jbreemhaar, dzucconi and 11 moremaaptehclodal
Metadata
Metadata
Assignees
Labels
blockingPrevents production or dev due to perf, bug, build error, etc..Prevents production or dev due to perf, bug, build error, etc..has-reproduction❤ Has a reproduction in a codesandbox or single minimal repository❤ Has a reproduction in a codesandbox or single minimal repository