XO Sources - yarn build - javascript heap out of memory
-
Hi!
Thanks for the updates this morning! I went into my XO from sources build and first updated node from vers 8 to vers 12 using the link from the docs page on XO.
I was able to perform the git command, then the yarn command successfully. Whenever I attempt to run the yard build though, it is failing out during that process with a fatal error:
[14:46:13] Finished 'copyAssets' after 14 s [14:46:20] Finished 'buildStyles' after 20 s <--- Last few GCs ---> [3494:0x38b2480] 235157 ms: Mark-sweep 976.8 (1017.0) -> 976.3 (1020.8) MB, 2161.1 / 0.1 ms (average mu = 0.070, current mu = 0.000) allocation failure GC in old space requested [3494:0x38b2480] 237282 ms: Mark-sweep 976.3 (1020.8) -> 976.2 (1006.0) MB, 2124.4 / 0.1 ms (average mu = 0.036, current mu = 0.000) last resort GC in old space requested <--- JS stacktrace ---> ==== JS stack trace ========================================= 0: ExitFrame [pc: 0x13cf019] Security context: 0x0085cbb408d1 <JSObject> 1: _parseMappings(aka SourceMapConsumer_parseMappings) [0x8c8e17b73b9] [/opt/xen-orchestra/node_modules/vinyl-sourcemaps-apply/node_modules/source-map/lib/source-map-consumer.js:~423] [pc=0x1ff8fbd63088](this=0x2b25b7f80119 <BasicSourceMapConsumer map = 0x121ba3f798c9>,0x13d463300119 <Very long string[4787562]>,0x3d5d577401b9 <null>) 2: get [0x33654250bc5... FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0xa093f0 node::Abort() [gulp build] 2: 0xa097fc node::OnFatalError(char const*, char const*) [gulp build] 3: 0xb842ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [gulp build] 4: 0xb84629 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [gulp build] 5: 0xd30fe5 [gulp build] 6: 0xd31676 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [gulp build] 7: 0xd3def5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [gulp build] 8: 0xd3eda5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [gulp build] 9: 0xd40539 v8::internal::Heap::CollectAllAvailableGarbage(v8::internal::GarbageCollectionReason) [gulp build] 10: 0xd418b6 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [gulp build] 11: 0xd0867d v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::RootIndex, int, v8::internal::Object, v8::internal::AllocationType) [gulp build] 12: 0xd08770 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::RootIndex, int, v8::internal::AllocationType) [gulp build] 13: 0xf26b99 v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::AllocationType, v8::internal::MinimumCapacity) [gulp build] 14: 0xf2f11e v8::internal::Dictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::Add(v8::internal::Isolate*, v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, int*) [gulp build] 15: 0xf2f289 v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::AddNoUpdateNextEnumerationIndex(v8::internal::Isolate*, v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, int*) [gulp build] 16: 0xf317a3 v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::Add(v8::internal::Isolate*, v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, int*) [gulp build] 17: 0x1060a6c v8::internal::Runtime_AddDictionaryProperty(int, unsigned long*, v8::internal::Isolate*) [gulp build] 18: 0x13cf019 [gulp build] Aborted * xo-web:build ā Error: 134 ā 1 error Command failed with exit code 1.
I've tried removing the node_modules folder and re-running through the process, but it seems to keep failing at the same point.
Any ideas on why this is failing on me? I've been running XO on this Debian box for quite some time from sources. I usually just have to run through the git and then two yarn processes.
Thank you again!
+Rick -
You're running out of memory. Allocate more memory to the VM. I believe the current build requirement is 3GB.
-
Thanks Dan..
I went ahead and bumped it up from 2GB to 4GB.
I was poking around trying to find that on the website, but figured I'd give that a go.
Looks like that was the key.
-
-
You do need a lot of virtual memory for build but you can get by with 2GB ram + 4 GB swap if you tell nodejs to limit it self, by setting
export NODE_OPTIONS='--max-old-space-size=3072'
before starting the build process