From ee32cc6ec25a7f65d3b29b3264d3ac9377549255 Mon Sep 17 00:00:00 2001 From: "Michael S. Fischer" Date: Thu, 20 Dec 2018 00:13:22 -0800 Subject: [PATCH] Allow v8 to allocate more heap (#1336) Prevent out-of-memory errors encountered during `lerna bootstrap` on certain systems by allowing Node's v8 engine to allocate more heap. The default, even on 64-bit architectures, is too small (1.4GB) to complete compilation successfully, so we set it to 4GB for the bootstrap phase. --- .gitignore | 3 ++- build.sh | 1 + bump.sh | 4 ++-- create-missing-libraries.sh | 1 + install.sh | 3 +++ pack.sh | 1 + scripts/builddown | 3 +++ scripts/buildup | 3 +++ scripts/regen-l1.sh | 2 ++ scripts/run-integ-parallel | 3 +++ scripts/update-dependencies.sh | 2 ++ 11 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 91e60255b44d5..7b2c8a301c245 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,8 @@ pack coverage .nyc_output .LAST_BUILD -*.swp +*.sw[a-z] +*~ # we don't want tsconfig at the root /tsconfig.json diff --git a/build.sh b/build.sh index 505c8ef99d457..3a3d42cac6f0f 100755 --- a/build.sh +++ b/build.sh @@ -41,6 +41,7 @@ BUILD_INDICATOR=".BUILD_COMPLETED" rm -rf $BUILD_INDICATOR export PATH=node_modules/.bin:$PATH +export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" # Speed up build by reusing calculated tree hashes # On dev machine, this speeds up the TypeScript part of the build by ~30%. diff --git a/bump.sh b/bump.sh index 27bdd8a2584f1..5a23b6019b79e 100755 --- a/bump.sh +++ b/bump.sh @@ -6,8 +6,9 @@ if [ -z "${ver}" ]; then exit 1 fi -/bin/bash ./install.sh +export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}" +/bin/bash ./install.sh lerna publish --force-publish=* --skip-npm --skip-git --repo-version ${ver} @@ -23,4 +24,3 @@ cat > /tmp/context.json <