-
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
Memory Leak: Mutation + OptimisticResponse makes update function to leak #7339
Comments
I think that apollo-client/src/cache/inmemory/readFromStore.ts Lines 156 to 161 in 2e8cce1
holds a reference forever because it has no cleanup logic. I think it's exactly the same issue we had #7086 |
@kamilkisiela I've updated the Following your reproduction steps, I no longer see retainment paths for These changes were published in It might still be worthwhile to evict/forget |
Thanks, we're going to test it soon |
should #7276 be merged into master too? It should minimize amount of potential memory leaks too |
Let us know if this is still a concern with |
After executing a mutation with
update
function andoptimisticResponse
theupdate
function is hold in memory forever which leaks other referenced objects.How to reproduce the issue:
https://github.com/kamilkisiela/apollo-optimistic-response-pessimistic-memory-leak
chrome://inspector
Foo
class@benjamn I can confirm that
Cache.removeOptimistic
is called butFoo
is still thereapollo-client/src/core/QueryManager.ts
Line 273 in 291e8bd
The text was updated successfully, but these errors were encountered: