I'm pretty sure I have a memory leak. When I perform certain actions (e.g. opening a menu) repeatedly, then use the 3 heap snapshots trick, there's always leaked memory. The retainers are different each time. I disabled React Devtools and also tried a production build, but I still got the memory leak.
I spent 2 days trying to interpret the results, but I still have no idea what it means. E.g. here's an example of a memory leak:
It'll be great if someone knew the answers to any of these questions:
Is it correct to interpret this as: an
HTMLInputElementis somehow referencing a function that callsuseContext?What do "instruction_stream", "previous", and "context" in the retainers mean?
I know "(compiled code)" means it's V8 creating optimized versions of functions. However, it seems like Chrome is producing new optimized versions of "useContext" multiple times? I repeated the 3 heaps trick many times and "useContext" is in there every time.
Where can I find more about what "(code relocation info)", "(code deopt data)", "(source position table)", etc mean?
