-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
src: add percentage support to --max-old-space-size #59082
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
src: add percentage support to --max-old-space-size #59082
Conversation
|
Review requested:
|
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.
I'm -1 on re-interpreting a V8 flag with different semantic in Node.js as it could lead to confusions. I'd be open to a new flag though.
Isn't it dangerous having two different flags for the same underlying v8 option? |
|
We can define that a flag will alway take precedence over another, e.g. See It could also be a good practice to abort if both flags are set. When all three heap size options And, like mentioned, there are three heap size options. I'm -0 on introduce 3 new flags on each of them, TBH. |
As long as there's an agreed way of action, I don't mind changing the implementation |
|
Another approach would be to see if v8 would accept a patch adding this as an additional v8 flag... I can see it potentially being generically useful for all v8 users |
|
|
||
| // Parse the percentage value | ||
| char* end_ptr; | ||
| double percentage = |
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.
Why double? It's likely best to just allow integer values here between 0 and 100. Not critical, of course, I'd just find it a bit cleaner
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.
Why double? It's likely best to just allow integer values here between 0 and 100. Not critical, of course, I'd just find it a bit cleaner
Should this be an integer, or would a float provide better flexibility for nodes with a large amount of memory?
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.
Really depends on how granular we want it to be. Personally I'd be fine with integer and just not worry about fractional percentages but I'd be interested in what others think
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.
if it was a breaking change I would agree, but this is a new feature, why not support more usecases even if they are rare?
I have already approached the V8 team, and they have indicated that a contribution to the Node.js project would be more appropriate. |
|
This will be a huge help, appreciate you working on this! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59082 +/- ##
==========================================
+ Coverage 90.04% 90.06% +0.02%
==========================================
Files 648 648
Lines 190978 191006 +28
Branches 37434 37438 +4
==========================================
+ Hits 171964 172028 +64
+ Misses 11641 11606 -35
+ Partials 7373 7372 -1
🚀 New features to boost your workflow:
|
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
a121c70 to
8e5f5ea
Compare
|
I've just force-pushed an update to this branch. I had to amend the commit history to unify the author identity across all commits. The underlying code logic has not changed. Apologies for any inconvenience this may cause. |
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: theanarkh <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: theanarkh <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: theanarkh <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]>
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: theanarkh <[email protected]> Reviewed-By: Daeyeon Jeong <[email protected]>
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
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
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
nodejs/node#59082 (cherry picked from commit 851df7e)
* 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 <[email protected]> Co-authored-by: Shelley Vohr <[email protected]>
* 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 <[email protected]>
* chore: upgrade Node.js to v24.10.0 * chore: fixup crypto patch * chore: fixup crypto test patch * src: prepare for v8 sandboxing nodejs/node#58376 * esm: fix module.exports export on CJS modules nodejs/node#57366 * chore: fixup lazyload fs patch * esm: Source Phase Imports for WebAssembly nodejs/node#56919 * module: remove --experimental-default-type nodejs/node#56092 * lib,src: refactor assert to load error source from memory nodejs/node#59751 * src: add source location to v8::TaskRunner nodejs/node#54077 * src: remove dependency on wrapper-descriptor-based CppHeap nodejs/node#54077 * src: do not use soon-to-be-deprecated V8 API nodejs/node#53174 * src: stop using deprecated fields of v8::FastApiCallbackOptions nodejs/node#54077 * test: update v8-stats test for V8 12.6 nodejs/node#54077 * esm: unflag --experimental-wasm-modules nodejs/node#57038 * test: adapt assert tests to stack trace changes nodejs/node#58070 * src,test: unregister the isolate after disposal and before freeing nodejs/node#58070 * src: use cppgc to manage ContextifyContext nodejs/node#56522 * src: replace uses of FastApiTypedArray nodejs/node#58070 * module: integrate TypeScript into compile cache nodejs/node#56629 * deps: update ada to 3.2.7 nodejs/node#59336 * src: make minor cleanups in encoding_binding.cc nodejs/node#57448 * src: switch from `Get/SetPrototype` to `Get/SetPrototypeV2` nodejs/node#55453 * src: use non-deprecated Get/SetPrototype methods nodejs/node#59671 * src: simplify string_bytes with views nodejs/node#54876 * src: improve utf8 string generation performance nodejs/node#54873 * src: use non-deprecated Utf8LengthV2() method nodejs/node#58070 * src: use non-deprecated WriteUtf8V2() method nodejs/node#58070 * src: refactor WriteUCS2 and remove flags argument nodejs/node#58163 * src: use String::WriteV2() in TwoByteValue nodejs/node#58164 * node-api: use WriteV2 in napi_get_value_string_utf16 nodejs/node#58165 * node-api: use WriteOneByteV2 in napi_get_value_string_latin1 nodejs/node#58325 * src: migrate WriteOneByte to WriteOneByteV2 nodejs/node#59634 * fs: introduce dirent\.parentPath nodejs/node#50976 * src: avoid copy by using std::views::keys nodejs/node#56080 * chore: fixup patch indices * fix: errant use of context->GetIsolate() * fix: tweak BoringSSL compat patch for new changes * fix: add back missing isolate dtor declaration * fixup! esm: fix module.exports export on CJS modules * cli: remove --no-experimental-fetch flag https://github.com/nodejs/node/pull/52611/files * esm: Source Phase Imports for WebAssembly nodejs/node#56919 * fixup! src: prepare for v8 sandboxing * chore: bump @types/node to v24 * chore: fix const assignment in crypto test * fix: sandbox pointer patch issues * chore: rework source phase import patch * src: add percentage support to --max-old-space-size nodejs/node#59082 * chore: fixup crypto tests * chore: HostImportModuleWithPhaseDynamically todo * fix: cjs esm failures * fix: v8::Object::Wrappable issues - v8/node@b72a615 - v8/node@490bac2 - v8/node@4896a0d * chore: remove deleted specs * src: use v8::ExternalMemoryAccounter nodejs/node#58070 * fs: port SonicBoom module to fs module as FastUtf8Stream nodejs/node#58897 * chore: tweak sandboxed pr patch * test: disable parallel/test-os-checked-function * test: use WHATWG URL instead of url.parse * fix: OPENSSL_secure_zalloc doesn't work in BoringSSL * chore: fix accidental extra line * 7017517: [defer-import-eval] Parse import defer syntax https://chromium-review.googlesource.com/c/v8/v8/+/7017517
nodejs/node#59082 Co-authored-by: Shelley Vohr <[email protected]>
* 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 <[email protected]>
* chore: upgrade Node.js to v24.10.0 * chore: fixup crypto patch * chore: fixup crypto test patch * src: prepare for v8 sandboxing nodejs/node#58376 * esm: fix module.exports export on CJS modules nodejs/node#57366 * chore: fixup lazyload fs patch * esm: Source Phase Imports for WebAssembly nodejs/node#56919 * module: remove --experimental-default-type nodejs/node#56092 * lib,src: refactor assert to load error source from memory nodejs/node#59751 * src: add source location to v8::TaskRunner nodejs/node#54077 * src: remove dependency on wrapper-descriptor-based CppHeap nodejs/node#54077 * src: do not use soon-to-be-deprecated V8 API nodejs/node#53174 * src: stop using deprecated fields of v8::FastApiCallbackOptions nodejs/node#54077 * test: update v8-stats test for V8 12.6 nodejs/node#54077 * esm: unflag --experimental-wasm-modules nodejs/node#57038 * test: adapt assert tests to stack trace changes nodejs/node#58070 * src,test: unregister the isolate after disposal and before freeing nodejs/node#58070 * src: use cppgc to manage ContextifyContext nodejs/node#56522 * src: replace uses of FastApiTypedArray nodejs/node#58070 * module: integrate TypeScript into compile cache nodejs/node#56629 * deps: update ada to 3.2.7 nodejs/node#59336 * src: make minor cleanups in encoding_binding.cc nodejs/node#57448 * src: switch from `Get/SetPrototype` to `Get/SetPrototypeV2` nodejs/node#55453 * src: use non-deprecated Get/SetPrototype methods nodejs/node#59671 * src: simplify string_bytes with views nodejs/node#54876 * src: improve utf8 string generation performance nodejs/node#54873 * src: use non-deprecated Utf8LengthV2() method nodejs/node#58070 * src: use non-deprecated WriteUtf8V2() method nodejs/node#58070 * src: refactor WriteUCS2 and remove flags argument nodejs/node#58163 * src: use String::WriteV2() in TwoByteValue nodejs/node#58164 * node-api: use WriteV2 in napi_get_value_string_utf16 nodejs/node#58165 * node-api: use WriteOneByteV2 in napi_get_value_string_latin1 nodejs/node#58325 * src: migrate WriteOneByte to WriteOneByteV2 nodejs/node#59634 * fs: introduce dirent\.parentPath nodejs/node#50976 * src: avoid copy by using std::views::keys nodejs/node#56080 * chore: fixup patch indices * fix: errant use of context->GetIsolate() * fix: tweak BoringSSL compat patch for new changes * fix: add back missing isolate dtor declaration * fixup! esm: fix module.exports export on CJS modules * cli: remove --no-experimental-fetch flag https://github.com/nodejs/node/pull/52611/files * esm: Source Phase Imports for WebAssembly nodejs/node#56919 * fixup! src: prepare for v8 sandboxing * chore: bump @types/node to v24 * chore: fix const assignment in crypto test * fix: sandbox pointer patch issues * chore: rework source phase import patch * src: add percentage support to --max-old-space-size nodejs/node#59082 * chore: fixup crypto tests * chore: HostImportModuleWithPhaseDynamically todo * fix: cjs esm failures * fix: v8::Object::Wrappable issues - v8/node@b72a615 - v8/node@490bac2 - v8/node@4896a0d * chore: remove deleted specs * src: use v8::ExternalMemoryAccounter nodejs/node#58070 * fs: port SonicBoom module to fs module as FastUtf8Stream nodejs/node#58897 * chore: tweak sandboxed pr patch * test: disable parallel/test-os-checked-function * test: use WHATWG URL instead of url.parse * fix: OPENSSL_secure_zalloc doesn't work in BoringSSL * chore: fix accidental extra line * 7017517: [defer-import-eval] Parse import defer syntax https://chromium-review.googlesource.com/c/v8/v8/+/7017517
* chore: upgrade Node.js to v24.10.0 Co-authored-by: Shelley Vohr <[email protected]> * chore: fixup crypto patch Co-authored-by: Shelley Vohr <[email protected]> * chore: fixup crypto test patch Co-authored-by: Shelley Vohr <[email protected]> * src: prepare for v8 sandboxing nodejs/node#58376 Co-authored-by: Shelley Vohr <[email protected]> * esm: fix module.exports export on CJS modules nodejs/node#57366 Co-authored-by: Shelley Vohr <[email protected]> * chore: fixup lazyload fs patch Co-authored-by: Shelley Vohr <[email protected]> * esm: Source Phase Imports for WebAssembly nodejs/node#56919 Co-authored-by: Shelley Vohr <[email protected]> * module: remove --experimental-default-type nodejs/node#56092 Co-authored-by: Shelley Vohr <[email protected]> * lib,src: refactor assert to load error source from memory nodejs/node#59751 Co-authored-by: Shelley Vohr <[email protected]> * src: add source location to v8::TaskRunner nodejs/node#54077 Co-authored-by: Shelley Vohr <[email protected]> * src: remove dependency on wrapper-descriptor-based CppHeap nodejs/node#54077 Co-authored-by: Shelley Vohr <[email protected]> * src: do not use soon-to-be-deprecated V8 API nodejs/node#53174 Co-authored-by: Shelley Vohr <[email protected]> * src: stop using deprecated fields of v8::FastApiCallbackOptions nodejs/node#54077 Co-authored-by: Shelley Vohr <[email protected]> * test: update v8-stats test for V8 12.6 nodejs/node#54077 Co-authored-by: Shelley Vohr <[email protected]> * esm: unflag --experimental-wasm-modules nodejs/node#57038 Co-authored-by: Shelley Vohr <[email protected]> * test: adapt assert tests to stack trace changes nodejs/node#58070 Co-authored-by: Shelley Vohr <[email protected]> * src,test: unregister the isolate after disposal and before freeing nodejs/node#58070 Co-authored-by: Shelley Vohr <[email protected]> * src: use cppgc to manage ContextifyContext nodejs/node#56522 Co-authored-by: Shelley Vohr <[email protected]> * src: replace uses of FastApiTypedArray nodejs/node#58070 Co-authored-by: Shelley Vohr <[email protected]> * module: integrate TypeScript into compile cache nodejs/node#56629 Co-authored-by: Shelley Vohr <[email protected]> * deps: update ada to 3.2.7 nodejs/node#59336 Co-authored-by: Shelley Vohr <[email protected]> * src: make minor cleanups in encoding_binding.cc nodejs/node#57448 Co-authored-by: Shelley Vohr <[email protected]> * src: switch from `Get/SetPrototype` to `Get/SetPrototypeV2` nodejs/node#55453 Co-authored-by: Shelley Vohr <[email protected]> * src: use non-deprecated Get/SetPrototype methods nodejs/node#59671 Co-authored-by: Shelley Vohr <[email protected]> * src: simplify string_bytes with views nodejs/node#54876 Co-authored-by: Shelley Vohr <[email protected]> * src: improve utf8 string generation performance nodejs/node#54873 Co-authored-by: Shelley Vohr <[email protected]> * src: use non-deprecated Utf8LengthV2() method nodejs/node#58070 Co-authored-by: Shelley Vohr <[email protected]> * src: use non-deprecated WriteUtf8V2() method nodejs/node#58070 Co-authored-by: Shelley Vohr <[email protected]> * src: refactor WriteUCS2 and remove flags argument nodejs/node#58163 Co-authored-by: Shelley Vohr <[email protected]> * src: use String::WriteV2() in TwoByteValue nodejs/node#58164 Co-authored-by: Shelley Vohr <[email protected]> * node-api: use WriteV2 in napi_get_value_string_utf16 nodejs/node#58165 Co-authored-by: Shelley Vohr <[email protected]> * node-api: use WriteOneByteV2 in napi_get_value_string_latin1 nodejs/node#58325 Co-authored-by: Shelley Vohr <[email protected]> * src: migrate WriteOneByte to WriteOneByteV2 nodejs/node#59634 Co-authored-by: Shelley Vohr <[email protected]> * fs: introduce dirent\.parentPath nodejs/node#50976 Co-authored-by: Shelley Vohr <[email protected]> * src: avoid copy by using std::views::keys nodejs/node#56080 Co-authored-by: Shelley Vohr <[email protected]> * chore: fixup patch indices Co-authored-by: Shelley Vohr <[email protected]> * fix: errant use of context->GetIsolate() Co-authored-by: Shelley Vohr <[email protected]> * fix: tweak BoringSSL compat patch for new changes Co-authored-by: Shelley Vohr <[email protected]> * fix: add back missing isolate dtor declaration Co-authored-by: Shelley Vohr <[email protected]> * fixup! esm: fix module.exports export on CJS modules Co-authored-by: Shelley Vohr <[email protected]> * cli: remove --no-experimental-fetch flag https://github.com/nodejs/node/pull/52611/files Co-authored-by: Shelley Vohr <[email protected]> * esm: Source Phase Imports for WebAssembly nodejs/node#56919 Co-authored-by: Shelley Vohr <[email protected]> * fixup! src: prepare for v8 sandboxing Co-authored-by: Shelley Vohr <[email protected]> * chore: bump @types/node to v24 Co-authored-by: Shelley Vohr <[email protected]> * chore: fix const assignment in crypto test Co-authored-by: Shelley Vohr <[email protected]> * fix: sandbox pointer patch issues Co-authored-by: Shelley Vohr <[email protected]> * chore: rework source phase import patch Co-authored-by: Shelley Vohr <[email protected]> * src: add percentage support to --max-old-space-size nodejs/node#59082 Co-authored-by: Shelley Vohr <[email protected]> * chore: fixup crypto tests Co-authored-by: Shelley Vohr <[email protected]> * chore: HostImportModuleWithPhaseDynamically todo Co-authored-by: Shelley Vohr <[email protected]> * fix: cjs esm failures Co-authored-by: Shelley Vohr <[email protected]> * fix: v8::Object::Wrappable issues - v8/node@b72a615 - v8/node@490bac2 - v8/node@4896a0d Co-authored-by: Shelley Vohr <[email protected]> * chore: remove deleted specs Co-authored-by: Shelley Vohr <[email protected]> * src: use v8::ExternalMemoryAccounter nodejs/node#58070 Co-authored-by: Shelley Vohr <[email protected]> * fs: port SonicBoom module to fs module as FastUtf8Stream nodejs/node#58897 Co-authored-by: Shelley Vohr <[email protected]> * chore: tweak sandboxed pr patch Co-authored-by: Shelley Vohr <[email protected]> * test: disable parallel/test-os-checked-function Co-authored-by: Shelley Vohr <[email protected]> * test: use WHATWG URL instead of url.parse Co-authored-by: Shelley Vohr <[email protected]> * fix: OPENSSL_secure_zalloc doesn't work in BoringSSL Co-authored-by: Shelley Vohr <[email protected]> * chore: fix accidental extra line Co-authored-by: Shelley Vohr <[email protected]> * 7017517: [defer-import-eval] Parse import defer syntax https://chromium-review.googlesource.com/c/v8/v8/+/7017517 Co-authored-by: Shelley Vohr <[email protected]> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]>
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