Memory leak when using atomFamily/selectorFamily
See original GitHub issueHello there,
The resources created by atomFamily
and selectorFamily
are not being properly freed when the specific key
changes or if the component using the related RecoilState<T>
unmounts.
Since I believe that memory management isn’t properly implemented yet, both utils should be marked as _UNSAFE
.
https://codesandbox.io/s/cranky-booth-penix?file=/src/App.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:19 (9 by maintainers)
Top Results From Across the Web
atomFamily — Jotai, primitive and flexible state management ...
Unless you explicitly remove unused params, this leads to memory leaks. This is crucial if you use infinite number of params.
Read more >how to implement typical use-case with recoil - Stack Overflow
Potentially, my list just needs to be state vs from a selector family query and it can get set from different places where...
Read more >/docs/utils/atom-family.mdx | jotai@v1.6.5 | Deno
Unless you explicitly remove unused params, this leads to memory leaks.This is crucial if you use infinite number of params.
Read more >atomFamily(options) - Recoil
For dynamic defaults based on other state use a selectorFamily() , which also has access to the parameter value. Don't just use selector()...
Read more >recoil | Yarn - Package Manager
Change Log. UPCOMING. Add new changes here as they land. 0.7.6 (2022-10-06). Workaround for React 18 environments with nested renderers that don't support ......
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
Just FYI we are working on the memory issue with use of family utils, and should have something to announce about it in the near future.
Could this be related? I am getting this warning and cannot seem to figure out a way to get rid of it.