Skip to content

Commit

Permalink
chore: increase vm.max_map_count to (hopefully) mitigate OOM errors (#…
Browse files Browse the repository at this point in the history
…16752)

The vm.max_map_count on our CodeBuild instances is fairly low (65530) compared
to our max threads (1125977). Based on a NodeJS issue troubleshooting thread
(nodejs/help#2809), trying to see if increasing this
value stabilizes our builds.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
njlynch authored Oct 1, 2021
1 parent 810d2d9 commit b6da2b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions buildspec-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ phases:

# Install yarn if it wasn't already present in the image
- yarn --version || npm -g install yarn

# Packing the mono-libraries (monocdk & aws-cdk-lib) can cause
# memory errors. Increasing this value allows our build to more consistently succeed
- (command -v sysctl || yum install -y procps-ng) && /sbin/sysctl -w vm.max_map_count=2251954
build:
commands:
- /bin/bash ./build.sh --extract
Expand Down
4 changes: 4 additions & 0 deletions buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ phases:

# Install yarn if it wasn't already present in the image
- yarn --version || npm -g install yarn

# Packing the mono-libraries (monocdk & aws-cdk-lib) can cause
# memory errors. Increasing this value allows our build to more consistently succeed
- /sbin/sysctl -w vm.max_map_count=2251954
build:
commands:
- 'if ${BUMP_CANDIDATE:-false}; then /bin/bash ./scripts/bump-candidate.sh; fi'
Expand Down

0 comments on commit b6da2b4

Please sign in to comment.