◐ Shell
clean mode source ↗

src: add percentage support to --max-old-space-size by Asaf-Federman · Pull Request #59082 · nodejs/node

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

lib / src

Issues and PRs related to general changes in the lib or src directory.

needs-ci

PRs that need a full CI run.

labels

Jul 16, 2025

legendecas

jasnell

legendecas

This commit adds support for specifying --max-old-space-size as a
percentage of system memory, in addition to the existing MB format.
A new HandleMaxOldSpaceSizePercentage method parses percentage values,
validates that they are within the 0-100% range, and provides clear
error messages for invalid input. The heap size is now calculated
based on available system memory when a percentage is used.

Test coverage has been added for both valid and invalid cases.
Documentation and the JSON schema for CLI options have been updated
with examples for both formats.

Refs: nodejs#57447

legendecas

Asaf-Federman added a commit to Asaf-Federman/node that referenced this pull request

Sep 4, 2025
This commit adds support for specifying --max-old-space-size as a
percentage of system memory, in addition to the existing MB format.
A new HandleMaxOldSpaceSizePercentage method parses percentage values,
validates that they are within the 0-100% range, and provides clear
error messages for invalid input. The heap size is now calculated
based on available system memory when a percentage is used.

Test coverage has been added for both valid and invalid cases.
Documentation and the JSON schema for CLI options have been updated
with examples for both formats.

Refs: nodejs#57447
PR-URL: nodejs#59082
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>

@richardlau richardlau added the semver-minor

PRs that contain new features and should be released in the next minor version.

label

Sep 17, 2025

Asaf-Federman added a commit to Asaf-Federman/node that referenced this pull request

Oct 9, 2025
This commit adds support for specifying --max-old-space-size as a
percentage of system memory, in addition to the existing MB format.
A new HandleMaxOldSpaceSizePercentage method parses percentage values,
validates that they are within the 0-100% range, and provides clear
error messages for invalid input. The heap size is now calculated
based on available system memory when a percentage is used.

Test coverage has been added for both valid and invalid cases.
Documentation and the JSON schema for CLI options have been updated
with examples for both formats.

Refs: nodejs#57447
PR-URL: nodejs#59082
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>

Asaf-Federman added a commit to Asaf-Federman/node that referenced this pull request

Oct 11, 2025
This commit adds support for specifying --max-old-space-size as a
percentage of system memory, in addition to the existing MB format.
A new HandleMaxOldSpaceSizePercentage method parses percentage values,
validates that they are within the 0-100% range, and provides clear
error messages for invalid input. The heap size is now calculated
based on available system memory when a percentage is used.

Test coverage has been added for both valid and invalid cases.
Documentation and the JSON schema for CLI options have been updated
with examples for both formats.

Refs: nodejs#57447
PR-URL: nodejs#59082
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>

aduh95 pushed a commit that referenced this pull request

Oct 17, 2025
This commit adds support for specifying --max-old-space-size as a
percentage of system memory, in addition to the existing MB format.
A new HandleMaxOldSpaceSizePercentage method parses percentage values,
validates that they are within the 0-100% range, and provides clear
error messages for invalid input. The heap size is now calculated
based on available system memory when a percentage is used.

Test coverage has been added for both valid and invalid cases.
Documentation and the JSON schema for CLI options have been updated
with examples for both formats.

Refs: #57447
PR-URL: #59082
Backport-PR-URL: #59631
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>

aduh95 added a commit that referenced this pull request

Oct 17, 2025
Notable changes:

http:
  * (SEMVER-MINOR) add shouldUpgradeCallback to let servers control HTTP upgrades (Tim Perry) #59824
src:
  * (SEMVER-MINOR) add percentage support to --max-old-space-size (Asaf Federman) #59082

PR-URL: #60230

aduh95 added a commit that referenced this pull request

Oct 17, 2025
Notable changes:

http:
  * (SEMVER-MINOR) add shouldUpgradeCallback to let servers control HTTP upgrades (Tim Perry) #59824
src:
  * (SEMVER-MINOR) add percentage support to --max-old-space-size (Asaf Federman) #59082

PR-URL: #60230

aduh95 added a commit that referenced this pull request

Oct 18, 2025
Notable changes:

cli:
  * (SEMVER-MINOR) add `--use-env-proxy` (Joyee Cheung) #59151
http:
  * (SEMVER-MINOR) support http proxy for fetch under `NODE_USE_ENV_PROXY` (Joyee Cheung) #57165
  * (SEMVER-MINOR) add `shouldUpgradeCallback` to let servers control HTTP upgrades (Tim Perry) #59824
http,https:
  * (SEMVER-MINOR) add built-in proxy support in `http`/`https.request` and `Agent` (Joyee Cheung) #58980
src:
  * (SEMVER-MINOR) add percentage support to `--max-old-space-size` (Asaf Federman) #59082

PR-URL: #60230

aduh95 added a commit that referenced this pull request

Oct 18, 2025
Notable changes:

cli:
  * (SEMVER-MINOR) add `--use-env-proxy` (Joyee Cheung) #59151
http:
  * (SEMVER-MINOR) support http proxy for fetch under `NODE_USE_ENV_PROXY` (Joyee Cheung) #57165
  * (SEMVER-MINOR) add `shouldUpgradeCallback` to let servers control HTTP upgrades (Tim Perry) #59824
http,https:
  * (SEMVER-MINOR) add built-in proxy support in `http`/`https.request` and `Agent` (Joyee Cheung) #58980
src:
  * (SEMVER-MINOR) add percentage support to `--max-old-space-size` (Asaf Federman) #59082

PR-URL: #60230

aduh95 added a commit that referenced this pull request

Oct 20, 2025
Notable changes:

cli:
  * (SEMVER-MINOR) add `--use-env-proxy` (Joyee Cheung) #59151
http:
  * (SEMVER-MINOR) support http proxy for fetch under `NODE_USE_ENV_PROXY` (Joyee Cheung) #57165
  * (SEMVER-MINOR) add `shouldUpgradeCallback` to let servers control HTTP upgrades (Tim Perry) #59824
http,https:
  * (SEMVER-MINOR) add built-in proxy support in `http`/`https.request` and `Agent` (Joyee Cheung) #58980
src:
  * (SEMVER-MINOR) add percentage support to `--max-old-space-size` (Asaf Federman) #59082

PR-URL: #60230

codebytere added a commit to electron/electron that referenced this pull request

Oct 23, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 23, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 23, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 24, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 24, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 27, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 28, 2025

jkleinsc pushed a commit to electron/electron that referenced this pull request

Oct 29, 2025

codebytere added a commit to electron/electron that referenced this pull request

Oct 30, 2025

jkleinsc added a commit to electron/electron that referenced this pull request

Oct 30, 2025
* chore: bump node in DEPS to v22.21.0

* chore: bump node in DEPS to v22.21.1

* chore: update patches

* fixup patches/node/api_remove_deprecated_getisolate.patch

* src: add percentage support to --max-old-space-size

nodejs/node#59082
(cherry picked from commit 851df7e)

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

jkleinsc added a commit to electron/electron that referenced this pull request

Oct 30, 2025

jkleinsc added a commit to electron/electron that referenced this pull request

Oct 30, 2025

codebytere pushed a commit to electron/electron that referenced this pull request

Oct 30, 2025
* chore: bump node in DEPS to v22.21.0

* chore: bump node in DEPS to v22.21.1

* chore: update patches

* lib,src: refactor assert to load error source from memory

nodejs/node#59751

* src: add percentage support to --max-old-space-size

nodejs/node#59082

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

codebytere added a commit to electron/electron that referenced this pull request

Oct 30, 2025

trop Bot added a commit to electron/electron that referenced this pull request

Oct 30, 2025

ckerr pushed a commit to electron/electron that referenced this pull request

Oct 31, 2025
* chore: bump node in DEPS to v22.21.0

* chore: bump node in DEPS to v22.21.1

* chore: update patches

* lib,src: refactor assert to load error source from memory

nodejs/node#59751

* src: add percentage support to --max-old-space-size

nodejs/node#59082

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>