Node: The property heap_size_limit from getHeapStatistics is incorrect for memory over 4032MB

Created on 8 Dec 2016  ·  1Comment  ·  Source: nodejs/node

  • Version: 7.2.1
  • Platform: Linux 3.10.0-327.10.1.el7.x86_64 #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

V8 Engine process

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanjunzhi picture fanjunzhi  ·  3Comments

srl295 picture srl295  ·  3Comments

stevenvachon picture stevenvachon  ·  3Comments

danielstaleiny picture danielstaleiny  ·  3Comments

Brekmister picture Brekmister  ·  3Comments