Skip to content
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

cli: allow --huge-max-old-generation-size in NODE_OPTIONS #32251

Closed

Conversation

addaleax
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 13, 2020
@addaleax addaleax added the cli Issues and PRs related to the Node.js command line interface. label Mar 13, 2020
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Mar 13, 2020

CI: https://ci.nodejs.org/job/node-test-pull-request/29816/ (:white_check_mark:)

Copy link
Member

@wesleytodd wesleytodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also add what it increased to?

As you said on twitter: "For machines with a lot of RAM, that behavior is changed to 4GB on x64 if --huge-max-old-generation-size is passed to V8."

@addaleax
Copy link
Member Author

Honestly, I doubt that many people would use end up using this – I’m okay with documenting it more verbosely, but it gets tricky to say that this increases the limit of the default limit of the heap (and not the actual limit like --max-old-space-size does).

Ultimately, it probably makes more sense to document --max-old-space-size explicitly in the CLI docs + the man page – this could be mentioned as a detail there, then. (I was kind of surprised to see that we don’t already document --max-old-space-size, tbh.)

@wesleytodd
Copy link
Member

wesleytodd commented Mar 13, 2020

I guess I have one other question:

Is there a reason node is not defaulting to --huge-max-old-generation-size? It seems like for most cases this is the correct default for >=16gb situations. Not many folks are running servers with that (maybe a huge assumption), and for local machines it seems like a safe default.

@mmarchini
Copy link
Contributor

I think this goes back to: should we be documenting V8 flags? While I agree these flags are important, it's still not something under our control. The behavior can change across V8 versions and we don't have test their behaviors, only for their existence.

I'm not against it, especially for important flags like memory-tuning, but maybe there's something else we can do? Could we add a NODE_V8_OPTIONS environment variable instead, so it's explicit those flags are not supported by us? For the memory-related flags, could Node.js expose a "simplified" tuning flag (and those wanting something more fine-tuned can use the V8 flags)?

@addaleax
Copy link
Member Author

Is there a reason node is not defaulting to --huge-max-old-generation-size? It seems like for most cases this is the correct default for >=16gb situations. Not many folks are running servers with that (maybe a huge assumption), and for local machines it seems like a safe default.

@wesleytodd Yeah, I've thought about that too. It would be fairly easy to make that happen, I'm not sure why it's not the default in V8.

@mmarchini Yeah, I think it's a bit of a grey are, but I'd prefer to keep them unless we have a reason to disable some of them...

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 20, 2020
addaleax added a commit that referenced this pull request Mar 20, 2020
PR-URL: #32251
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
@addaleax
Copy link
Member Author

Landed in 95e3733

@addaleax addaleax closed this Mar 20, 2020
@addaleax addaleax deleted the allow--huge-max-old-generation-size branch March 20, 2020 13:22
MylesBorins pushed a commit that referenced this pull request Mar 24, 2020
PR-URL: #32251
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 24, 2020
@targos targos added semver-minor PRs that contain new features and should be released in the next minor version. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 22, 2020
targos pushed a commit to targos/node that referenced this pull request Apr 25, 2020
PR-URL: nodejs#32251
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
targos pushed a commit that referenced this pull request Apr 28, 2020
PR-URL: #32251
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. cli Issues and PRs related to the Node.js command line interface. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants