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
SSR: store processed documents on the Link instance to avoid memory leak #209
SSR: store processed documents on the Link instance to avoid memory leak #209
Conversation
Codecov Report
@@ Coverage Diff @@
## master #209 +/- ##
==========================================
- Coverage 92.71% 92.68% -0.04%
==========================================
Files 3 2 -1
Lines 412 410 -2
Branches 121 121
==========================================
- Hits 382 380 -2
Misses 28 28
Partials 2 2
Continue to review full report at Codecov.
|
Should this be instead cached on the query instead of on the link? I wasn’t aware of this cache, I’m not exactly certain I understand what’s being cached and the risk. |
@fbartho it might be cached on the query too, what's the difference? I didn't want to change the logic, just wanted to fix the leak. On the server, we recreate const removed = new Map(); This cache cannot be cleared via recreating Let me know if it makes sense. |
Also, I checked the code in |
@fbartho any thoughts on this one? |
@valerybugakov I tagged this with a release milestone, to make it clear I hope to release a fix soon (I was on vacation when you submitted this). Question for you: Would you mind researching why they removed their cache? My preference is to trust their performance analyses. If they had a reason, then we can copy their code again here. Removing the cache would be simpler to maintain! |
@valerybugakov -- I'm working on a new release here, did you see my question re: "Why did they remove their cache?" |
Hey @fbartho, I didn't have time to do this research |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going the get this out in a beta release today!
Prevents memory leak when
apollo-link-rest
is used on the server caused by storing processed documents in the module closure.