-
Notifications
You must be signed in to change notification settings - Fork 30k
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
vm: --expose-gc
breaks gc and crashes with --max-old-space-size
#3249
Comments
/cc @domenic |
Does this repro without vm shenanigans? Probably /cc @nodejs/v8 instead of just me. |
@domenic To the moment, I wasn't able to reproduce this without using |
Something has improved recently, but this is still not fixed. On v5.5.0 and v4.2.6 — does not crash, the speed start from ~600 ops/sec.
On v5.0.0 the results were the same as in the initial post (the same as in v4.1.0). |
I have been diving into memory management with vm and new context. This looks as simple as each new context created has the gc global added to it after the context is create. I guess the gc has a pointer to the context and with expose-gc the context has a pointer to the gc. None of these contexts ever get cleaned up. This can simple be solved with the context created as a variable 'c'. Then after runInNewContext is executed c.gc = null; Memory back to normal. Maybe createContext should not assign global gc. |
--expose-gc
breaks gc and crashes with --max-old-space-size
--expose-gc
breaks gc and crashes with --max-old-space-size
@asadenton Thanks. This is clearly vm-related, then. |
Have you identified the code (file/source lines) in Node.js which does what you describe in you earlier comment ? |
Sorry, I have not. Once I discovered I could clear the vm vars and it all worked I moved on with that. |
@ChALkeR is this still an issue ? I get the following numbers with v6.3.0:
|
Yes, looks fixed to me. Nice! |
Extracted from #3113.
Verified using 4.1.0 (pre-built, from nodejs.org) and 4.1.2 (Archlinux packages).
Testcase is at the very top of #3113, a fancier version here (but it works with the original one):
The speed starts from ~28 ops/sec in all cases.
heapTotal
stabilizes at ~1260 MiB. The speed stabilizes at ~25 ops/sec.--expose-gc
(without changing the code to triggergc()
),heapTotal
stabilizes at about ~1430 MiB. The speed stabilizes at ~10 ops/sec.--max-old-space-size=32
,heapTotal
stabilizes at about ~48 MiB. The speed stabilizes at ~26.6 ops/sec.--max-old-space-size=32 --expose-gc
, node crashes after ~30 iterations withFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
.--max-old-space-size=200 --expose-gc
, node crashes after ~280 iterations withFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
.--max-old-space-size=1000 --expose-gc
, node crashes after ~1290 iterations withFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
(after hanging for about a minute at 0.5 ops/sec).Yes, I know that the above speed measurement isn't accurate, it doesn't matter much.
The text was updated successfully, but these errors were encountered: