-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak related to require #9697
Comments
We have a similar leak / heap growth speed, very annoying:
|
I added "Allocation timelines - Allocation view" screenshot to the original ticket. I don't know if that's normal but seems suspicious to me. There are many nodes with the same long nested recursion. |
@ron23 could you test with 25.5? In addition to the graceful-fs fix it's more aggressively clearing require caches after test runs rather than relying on GC |
@SimenB I've been following #9443 :) I tried it when it got merged I also updated JSDOM to I still get leaks reported if I run with |
|
I had the same issue as in #9507 I'll rerun it with inspect to check the require part |
That should be fixed in [email protected] |
Oh right, you meant that you need it for I do find it weird a manual GC makes a difference, if anything it should be slower as GC is quite slow, so normally it's better to just let V8 run it when it feels like it |
It's been a couple of years, so I'll close this. From what I can tell, this was never tested after the JSDOM fix? If it's still a problem, please open up a new issue with reproduction steps. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
We have a decent size JS&TS project suffering from memory leak. Within a few minutes the heap grows to 2GB and testing becomes extremely slow until I get allocation error.
I've looked at all memory leak related issues but none of them seem to solve this problem.
Specifically: #8331 && #9443.
I tried the patch version in #8331 but that didn't help.
On the heap snapshot I'm seeing many occurrences of stuff that seem related to requiring module but I don't really understand it.
I tried running with --detectLeaks but it seems broken and reports a leak even for a naive test.
execution log (partial)
Sampling Profiles snapshots
Allocation Snapshot
Heap Snapshot
I didn't find clear repetition there and since it's massive didn't see the point adding it here.
Performance snapshot
Notice all the pink is requiring modules
Allocation timelines - Allocation view
This is just an example, many of the nodes have this nested tree structure
Expected behavior
Not have a leak and the heap size shouldn't grow that much.
Link to repl or repo (highly encouraged)
I wasn't able to isolate the issue.
envinfo
Edit:
I tried running with
w=1
and test was fast but with a leak. When I ran withw=4
it was MUCH slower but the leak was much smaller (if at all). Using strong 2019 Macbook.The text was updated successfully, but these errors were encountered: