From 6550a90c5bf49bc723b810978d0f41fd95f84ed9 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Wed, 17 Mar 2021 14:45:54 +0800 Subject: [PATCH] [Website] Increase the memory limit for the build (#9930) --- *Motivation* The website builds always failed by OOM. ``` FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory <--- Last few GCs ---> [3385:0x284bf60] 70277 ms: Mark-sweep 1373.5 (1423.3) > 1372.6 (1423.3) MB, 2874.4 / 0.0 ms (average mu = 0.140, current mu = 0.040) allocation failure scavenge might not succeed [3385:0x284bf60] 73197 ms: Mark-sweep 1373.8 (1423.3) > 1372.8 (1423.3) MB, 2917.9 / 0.0 ms (average mu = 0.074, current mu = 0.001) allocation failure scavenge might not succeed <--- JS stacktrace ---> ==== JS stack trace ========================================= 0: ExitFrame [pc: 0x257b9fdbf1d] Security context: 0x1427fb09e6c1 1: getArg [0x2df6a830c771] [/pulsar/site2/website/node_modules/@babel/generator/node_modules/source-map/lib/util.js:~18] [pc=0x257ba453330](this=0x2df6a830a5a1 ,aArgs=0x20026ec39139 ,aName=0x072e64624f69 ,aDefaultValue=0x20394b3026f1 ) 2: arguments adaptor frame... 1: 0x8fb090 node::Abort() [/usr/bin/node] 2: 0x8fb0dc [/usr/bin/node] 3: 0xb033be v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node] 4: 0xb035f4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node] 5: 0xef7652 [/usr/bin/node] 6: 0xef7758 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/bin/node] 7: 0xf03832 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node] 8: 0xf04164 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node] 9: 0xf06dd1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node] 10: 0xed0254 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/bin/node] 11: 0x117032e v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node] 12: 0x257b9fdbf1d Aborted (core dumped) error Command failed with exit code 134-- ``` *Modifications* - Increase the memory from 512mb to 2048gb --- site2/tools/build-site.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site2/tools/build-site.sh b/site2/tools/build-site.sh index 91363dbc24283..dbd4940995d3a 100755 --- a/site2/tools/build-site.sh +++ b/site2/tools/build-site.sh @@ -23,6 +23,7 @@ VERSION=`${ROOT_DIR}/src/get-project-version.py` set -x -e +export NODE_OPTIONS="--max-old-space-size=2048" #increase to 2gb, default is 512mb ${ROOT_DIR}/site2/tools/generate-api-docs.sh cd ${ROOT_DIR}/site2/website yarn @@ -76,4 +77,4 @@ mkdir -p ${ROOT_DIR}/generated-site/content cp -R ${ROOT_DIR}/generated-site/api ${ROOT_DIR}/generated-site/content cp -R ./build/pulsar/* ${ROOT_DIR}/generated-site/content cp -R ${ROOT_DIR}/generated-site/tools ${ROOT_DIR}/generated-site/content -cp -R ${ROOT_DIR}/site2/website/static/swagger/* ${ROOT_DIR}/generated-site/content/swagger/ \ No newline at end of file +cp -R ${ROOT_DIR}/site2/website/static/swagger/* ${ROOT_DIR}/generated-site/content/swagger/