-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
doc: correct definition of v8.getHeapStatistics().heap_size_limit #57029
Open
inwenis
wants to merge
2
commits into
nodejs:main
Choose a base branch
from
inwenis:heap-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semi space and young generation space are referring to the same concept. I think a more straightforward hint here will be pointing to
--max-heap-size
:Though, both
--max_semi_space_size
and--max_old_space_size
take precedence over--max-heap-size
option, and are hinted vianode --v8-options
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://nodejs.org/api/cli.html does not describe
--max-heap-size
.The semi space and young generation space are referring to the same concept - I agree
But the docs below say
heap=old-space + semi-space + 3*semi-space (young generation)
however my tests showed that this math doesn't hold up with reality.https://nodejs.org/api/cli.html#--max-semi-space-sizesize-in-mib
I would love for the docs to be exhaustive and non ambiguous.
It seemed to me that the least ambiguous definition of the heap size is the sum of its "parts".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That document refers to the large new object space, whose size is implied with the
--max-semi-space-size
, is also counted in the formula: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/heap/heap.cc;l=203-208?q=Heap::MaxReservedThere are many factors in V8 that can change the assumed formula of the heap limit size, like the conditions in the link above. Given that these flags are maintained in V8, rather than node, I'd still suggest refer to
--max-heap-size
, which is the most striaghtforward to set the general limit.