Skip to content

Commit

Permalink
build(package.json): set JS heap to 3 GB for typescript compilation
Browse files Browse the repository at this point in the history
On a laptop with 16 GB RAM the default JS heap size is not enough anymore
to do a full typescript build of the project from scratch.

The size of the heap for NodeJS processes gets determined at runtime by
an algorithm that (most likely) depends on the total RAM in your computer:
https://stackoverflow.com/a/75555120

For laptops with 16 GB RAM or less, the heap ends up being calculated to
an amount that is too low at this size of the project so we have to give
it a little nudge by specifying the parameter for heap size explicitly to
be 3 GB instead of the default.

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed May 17, 2024
1 parent 3e4f4a7 commit 8608ce7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"build:prod": "npm-run-all build:prod:frontend",
"build:prod:frontend": "lerna run build:prod:frontend",
"build:dev": "npm-run-all build:dev:backend webpack:dev:web build:dev:frontend",
"build:dev:backend": "npm-run-all tsc build:dev:backend:postbuild",
"build:dev:backend": "NODE_OPTIONS=\"--max_old_space_size=3072\" npm-run-all tsc build:dev:backend:postbuild",
"build:dev:frontend": "lerna run build:dev:frontend --scope='@hyperledger/cactus-example-*-frontend' --scope='@hyperledger/cacti-ledger-browser'",
"build:dev:common": "lerna exec --stream --scope '*/*common' -- 'del-cli dist/** && tsc --project ./tsconfig.json && webpack --env=dev --target=node --config ../../webpack.config.js'",
"build:dev:backend:postbuild": "lerna run build:dev:backend:postbuild",
Expand Down

0 comments on commit 8608ce7

Please sign in to comment.