reading from InMemoryCache causes memory leak (in React Native)
See original GitHub issueIntended outcome:
Calling readFragment
/writeFragment
should not increase memory usage at all.
Actual outcome:
Callling readFreagment
and then writeFragment
repeatedly will increase the memory usage.
Calling only readFragment
without writeFragment
will only increase the memory once, which I guess is some caching to avoid unnecessary reads?
How to reproduce the issue:
I have created a simple app with reproduction: apollo-memory-leak
Versions
System:
OS: macOS 11.5.2
Binaries:
Node: 14.16.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.11 - /usr/local/bin/npm
Browsers:
Chrome: 94.0.4606.71
Safari: 15.0
npmPackages:
@apollo/client: ^3.4.16 => 3.4.16
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Solving Memory Leaks with React Native - Enquero
Even when working with memory-managed languages there are cases where memory can be leaked. Leaks are the cause of the whole class of...
Read more >Advanced topics on caching in Apollo Client
This article describes special cases and considerations when using the Apollo Client cache. Bypassing the cache. Sometimes you shouldn't use the cache for...
Read more >Memory leak when using Apollo on react native - Stack Overflow
When using ApolloClient in our React NAtive app, we get a memory leak that crashes teh app within 30 seconds of the app...
Read more >Hunting JS memory leaks in React Native apps
If such a workflow leads to leaking, you should notice your app's memory consumption to grow after you repeat it several times. The...
Read more >@apollo/client | Yarn - Package Manager
Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t know if it’s the same issue, but I’ve also noticed a possible memory leak regression related to cache after upgrading from
3.4.10
to3.4.16
Unfortunately I can’t attach the full allocation sampling file as it contains proprietary code but here are some screenshots which might help:
@brainkim Thanks for update. Sure.