Page MenuHomePhabricator

Docker regularly throws "JavaScript heap out of memory" errors due to fork-ts-checker-webpack-plugin
Open, Needs TriagePublic

Description

Lately our Docker containers have been throwing JavaScript heap out of memory while Webpack is executing in the background, specifically fork-ts-checker-webpack-plugin. A quick web search revealed that this issue may be solved by increasing the memoryLimit value of this plugin though some users were reporting this did not fix the problem for them. We should look into this a bit further.

skin_laika_1          | =============
 95% emitting fork-ts-checker-webpack-pluginFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
skin_laika_1          | 
skin_laika_1          | <--- Last few GCs --->
skin_laika_1          | 
skin_laika_1          | [24:0x3628e10]   157797 ms: Mark-sweep 1370.8 (1402.3) -> 1370.6 (1401.8) MB, 101.9 / 0.0 ms  (average mu = 0.456, current mu = 0.000) last resort GC in old space requested
skin_laika_1          | [24:0x3628e10]   157908 ms: Mark-sweep 1370.6 (1401.8) -> 1370.6 (1401.8) MB, 110.7 / 0.0 ms  (average mu = 0.282, current mu = 0.000) last resort GC in old space requested
skin_laika_1          | 
skin_laika_1          | 
skin_laika_1          | <--- JS stacktrace --->
skin_laika_1          | 
skin_laika_1          | ==== JS stack trace =========================================
skin_laika_1          | 
skin_laika_1          |     0: ExitFrame [pc: 0x1d3dac25be1d]
skin_laika_1          | Security context: 0x132c5149e6e1 <JSObject>
skin_laika_1          |     1: byteLength(aka byteLength) [0x1b16e0d05ef1] [buffer.js:532] [bytecode=0x7910b2f59c1 offset=204](this=0x39d4e99026f1 <undefined>,string=0x2a07beda9a79 <Very long string[4747695]>,encoding=0x132c514bc8b1 <String[4]: utf8>)
skin_laika_1          |     2: arguments adaptor frame: 3->2
skin_laika_1          |     3: fromString(aka fromString) [0x1b16e0d1c2c1] [buffer.js:343] [bytecode=0x7910b2efdf1 offs...
skin_laika_1          | 
skin_laika_1          |  1: 0x8dbaa0 node::Abort() [node]
skin_laika_1          |  2: 0x8dbaec  [node]
skin_laika_1          |  3: 0xad83de v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
skin_laika_1          |  4: 0xad8614 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
skin_laika_1          |  5: 0xec5c42  [node]
skin_laika_1          |  6: 0xed545f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
skin_laika_1          |  7: 0xea500b v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
skin_laika_1          |  8: 0xfee8c3 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [node]
skin_laika_1          |  9: 0xad5a04 v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [node]
skin_laika_1          | 10: 0xae37b0 v8::String::Utf8Length() const [node]
skin_laika_1          | 11: 0x8f4776  [node]
skin_laika_1          | 12: 0xb60aff  [node]
skin_laika_1          | 13: 0xb61669 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
skin_laika_1          | 14: 0x1d3dac25be1d 
skin_laika_1          | Aborted (core dumped)
skin_laika_1          | npm ERR! code ELIFECYCLE
skin_laika_1          | npm ERR! errno 134
skin_laika_1          | npm ERR! laika@0.1.0 serve: `vue-cli-service serve`
skin_laika_1          | npm ERR! Exit status 134
skin_laika_1          | npm ERR! 
skin_laika_1          | npm ERR! Failed at the laika@0.1.0 serve script.
skin_laika_1          | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
skin_laika_1          | 
skin_laika_1          | npm ERR! A complete log of this run can be found in:
skin_laika_1          | npm ERR!     /root/.npm/_logs/2019-07-31T09_16_59_802Z-debug.log
fundraisingfrontend_skin_laika_1 exited with code 134

Event Timeline

Tim_WMDE created this task.Wed, Jul 31, 1:08 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptWed, Jul 31, 1:08 PM

I have not really had this issue anymore lately, I think this may have been fixed by the reduced CSS size from T229416. Ticket can potentially be closed unless you still have this issue.