From f609043e38ace6e6dccba92fa379bd69db398037 Mon Sep 17 00:00:00 2001 From: Nick Lynch Date: Fri, 1 Oct 2021 12:49:35 +0100 Subject: [PATCH] chore: increase vm.max_map_count to (hopefully) mitigate OOM errors (#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 (https://github.com/nodejs/help/issues/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* --- buildspec-pr.yaml | 4 ++++ buildspec.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/buildspec-pr.yaml b/buildspec-pr.yaml index 3d6ee87c8d1ff..647b78849b3e8 100644 --- a/buildspec-pr.yaml +++ b/buildspec-pr.yaml @@ -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 diff --git a/buildspec.yaml b/buildspec.yaml index 3f2bb4e7e1102..0fc990a17c805 100644 --- a/buildspec.yaml +++ b/buildspec.yaml @@ -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'