$env:NODE_OPTIONS="--max-old-space-size=SIZE" adds 48MB for no reason #4928
Replies: 0 comments 6 replies
-
JFYI 8 GiB = 8192 MiB, not 8196. The observed difference is exactly 48 MiB for some reason though. 8 GiB = 8 * 2^30 = 8192 * 2^20 = 8,589,934,592 bytes 8644460544 - 8594128896 = 50,331,648 bytes = 48 MiB (exactly) |
Beta Was this translation helpful? Give feedback.
-
I have the same issue on NodeJS 14.19.1.
The difference, 50331648 / 1024 / 1024, is 48 MiB (exactly). |
Beta Was this translation helpful? Give feedback.
-
Converted to a discussion because this is working as intended, not a bug. The garbage collector is a generational collector, i.e., there are two spaces: the young space (a.k.a. the nursery) and the old space.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version
17.3.0
Platform
x64
Subsystem
No response
What steps will reproduce the bug?
PS C:> $env:NODE_OPTIONS="--max-old-space-size=8196"
PS C:> node -e 'console.log(v8.getHeapStatistics().heap_size_limit)'
8644460544
How often does it reproduce? Is there a required condition?
every time
What is the expected behavior?
heap-size should be set to 8196MB (8GB)
What do you see instead?
8644460544 bytes (8244MB)
Additional information
The LTS version has a similar problem but with 24bytes, which breaks deserialization for 4096
Beta Was this translation helpful? Give feedback.
All reactions