I have a memory leak in some Jest test for a React app and from inspecting the heap dump it seems the culprit is that there are thousands of strings containing the entirety of react-dom.development.js sticking around in memory. This screenshot shows a very small section of what that looks like: Screencap of the heap
Inspecting them closer shows they're being kept around in GC root & global handles but to be honest I don't completely know what that means or why that would be the case.
More info about one of these strings
Can anyone clear this up a bit? I can't find any examples of strings or imports being the cause of a memory leak within Jest like this. For context it's a pretty large test suite but the only place I directly import react-dom in the codebase is the entrypoint where the root of the app is rendered.