You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Node 12 dynamic heap size maxes out at 2048MB #28202
Hi there. The Node 12 announcement contained a section about dynamic heap limits:
Properly configure default heap limits
This update will configure the JavaScript heap size based on available memory instead of using defaults that were set by V8 for use with browsers. In previous releases, unless configured, V8 defaulted to limiting the max heap size to 700 MB or 1400MB on 32 and 64-bit platforms respectively. Configuring the heap size based on available memory ensures that Node.js does not try to use more memory than is available and terminating when its memory is exhausted.
This is particularly useful when processing large data-sets. As before, it will still be possible to set — max-old-space-size to use a different limit if the default is not appropriate for your application.
The "will configure the JavaScript heap size based on available memory" part made me think the new limit was always relative to the total available memory. But as far as we can tell in angular/angular-cli#13734 (comment), there's still a default maximum at 2048MB.
Is this new default maximum intended? The blog post doesn't mention any maximum, just that it's based on available memory.
@sam-github it is very informative, thank you. This definitely is intentional. The comment also mentions that the maximum is likely too low and should be reviewed:
With this spelled out, it is worth pausing and thinking about this more deeply. I do think we need change the default on large machines. I routinely see workloads where the job fails with 'out of memory' when there clearly is enough memory available.
@joyeecheung#25576 (comment) is altering the limit to not be the default v8 one though. So I feel this is actually the right project to discuss the current limit.
Activity
sam-github commentedon Jun 13, 2019
Is #25576 (comment) informative?
MLoughry commentedon Jun 16, 2019
It's informative as to how it's currently implemented, but I'm not sure I gleaned enough (nor know enough) about V8 to understand why.
Is there a reason the ceiling can't be raised further? Or even dynamically changed at runtime with something like
v8.setFlagsFromString()?joyeecheung commentedon Jun 16, 2019
The current default comes from V8 so it would be more effective to ask in places like https://groups.google.com/forum/#!forum/v8-users
filipesilva commentedon Jun 17, 2019
@sam-github it is very informative, thank you. This definitely is intentional. The comment also mentions that the maximum is likely too low and should be reviewed:
@joyeecheung #25576 (comment) is altering the limit to not be the default v8 one though. So I feel this is actually the right project to discuss the current limit.