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

build(package.json): set JS heap to 3 GB for typescript compilation #3266

Merged

Conversation

petermetz
Copy link
Contributor

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 [email protected]

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

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 <[email protected]>
@petermetz petermetz force-pushed the build-fix-out-of-memory-tsc-errors branch from 880b5ae to b0faa6d Compare May 17, 2024 00:24
@petermetz petermetz merged commit 8608ce7 into hyperledger-cacti:main May 17, 2024
130 of 144 checks passed
@petermetz petermetz deleted the build-fix-out-of-memory-tsc-errors branch May 17, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants