Open 617976080 opened 3 years ago
Automatic freeing of memory is coming in (hopefully) the near future. Recoil is both experimental and used in production; you should weigh the risks against the benefits for your specific app.
selectorFamily
is actually much worse than atomFamily: it caches every input and every output for the lifetime of the app and there is no way to free this memory.
Recoil should only be used if your state tree atoms contain tiny bits of information. If you have a large list in an atom and then get() that atom in a selector: your app won't be able to last long before it crashes.
@davidmccabe Does the team have an update on this ? 🙏🏼
selectorFamily is actually much worse than atomFamily: it caches every input and every output for the lifetime of the app and there is no way to free this memory.
The selector cache is now configurable, but the actual selectors/atoms in a family are not yet enabled to be garbage collected.
According to the demo website, selectorFamily is used for requests with parameters. And I saw this issue: https://github.com/facebookexperimental/Recoil/issues/863, atomFamily has memory leak problem. So does selectorFamily have a similar problem? Recoil repository called facebookexperimental/recoil, Whether I can use it for production environments? Thank you very much for developing Recoil. I am looking forward to using it in my project. Thank you.