Skip to content

Commit

Permalink
Allow v8 to allocate more heap (aws#1336)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
otterley authored and RomainMuller committed Dec 20, 2018
1 parent d5cae61 commit ee32cc6
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pack
coverage
.nyc_output
.LAST_BUILD
*.swp
*.sw[a-z]
*~

# we don't want tsconfig at the root
/tsconfig.json
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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%.
Expand Down
4 changes: 2 additions & 2 deletions bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -23,4 +24,3 @@ cat > /tmp/context.json <<HERE
HERE

./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s --context /tmp/context.json

1 change: 1 addition & 0 deletions create-missing-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -euo pipefail

export PATH=node_modules/.bin:$PATH
export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

# Making sure the bare minimum packages allowing be able to test-build the generated packages is available:
lerna exec --scope=cfn2ts \
Expand Down
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -euo pipefail

export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"


echo "============================================================================================="
echo "installing repo-global dependencies..."
npm i --no-package-lock --global-style
Expand Down
1 change: 1 addition & 0 deletions pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# later read by bundle-beta.sh.
set -e
export PATH=$PWD/node_modules/.bin:$PATH
export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"
root=$PWD

distdir="$PWD/dist"
Expand Down
3 changes: 3 additions & 0 deletions scripts/builddown
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
set -euo pipefail

export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

scriptdir=$(cd $(dirname $0) && pwd)
scope=$(${scriptdir}/current-scope)
exec lerna run build --scope ${scope} --include-filtered-dependents
3 changes: 3 additions & 0 deletions scripts/buildup
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
set -euo pipefail

export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

scriptdir=$(cd $(dirname $0) && pwd)
scope=$(${scriptdir}/current-scope)
exec lerna run build --scope ${scope} --include-filtered-dependencies
2 changes: 2 additions & 0 deletions scripts/regen-l1.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

rm -f packages/@aws-cdk/*/lib/*.generated.*
node_modules/.bin/lerna --scope @aws-cdk/cfnspec run build
node_modules/.bin/lerna --scope cfn2ts run build
Expand Down
3 changes: 3 additions & 0 deletions scripts/run-integ-parallel
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
# Run unit tests in parallel in different regions
set -euo pipefail

export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

lerna=${LERNA:-node_modules/.bin/lerna}

# Only regions that support most services
Expand Down
2 changes: 2 additions & 0 deletions scripts/update-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -euo pipefail

export NODE_OPTIONS="--max-old-space-size=4096 ${NODE_OPTIONS:-}"

#----------------------------------------------------------------------
# PARSE ARGS

Expand Down

0 comments on commit ee32cc6

Please sign in to comment.