The property heap_size_limit from getHeapStatistics is incorrect for memory over 4032MB #10185
Closed
Description
- Version: 7.2.1
- Platform: Linux 3.10.0-327.10.1.el7.x86_64 deps: update openssl to 1.0.1j #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: v8
When calling the v8 module's getHeapStatistics function the heap_size_limit property is incorrect for memory sizes set over 4GB. Specifically if you set max_old_space >= 4032, heap_size_limit is incorrect. To reproduce:
node --max_old_space_size=3072
require('v8').getHeapStatistics().heap_size_limit
3288334336
This is as you would expect, but look at what 4096 does:
node --max_old_space_size=4096
require('v8').getHeapStatistics().heap_size_limit
67108864
64 MB???? That's not right. After some trial and error, the magic breaking point is 4032:
node --max_old_space_size=4032
require('v8').getHeapStatistics().heap_size_limit
0
Heap size of ZERO, when set to 4092.
This also happens on Mac OS X 10.11.6 and Node v5.11.0