Crashing with out of memory exception #227
Description
I'm having a tough time figuring out exactly what/why/when caused this exception to start happening, but I seem to have narrowed it down to only happening after v2.2.1
When running through a webpack dev server and making changes, after a while the process crashes with this exception:
Error: channel closed
at ChildProcess.target.send (internal/child_process.js:540:16)
at runChecker (/Users/mv/dev/js/product-designer/node_modules/awesome-typescript-loader/src/instance.ts:388:22)
at invokeFunc (/Users/mv/dev/js/product-designer/node_modules/lodash/lodash.js:10024:23)
at trailingEdge (/Users/mv/dev/js/product-designer/node_modules/lodash/lodash.js:10071:18)
at Timeout.timerExpired [as _onTimeout] (/Users/mv/dev/js/product-designer/node_modules/lodash/lodash.js:10059:18)
at tryOnTimeout (timers.js:232:11)
at Timer.listOnTimeout (timers.js:202:5)
Some of the time it is preceded by this error:
<--- Last few GCs --->
43983 ms: Mark-sweep 1311.1 (1433.0) -> 1310.9 (1440.0) MB, 1450.2 / 0.0 ms [allocation failure] [GC in old space requested].
45501 ms: Mark-sweep 1310.9 (1440.0) -> 1310.9 (1440.0) MB, 1518.8 / 0.0 ms [allocation failure] [GC in old space requested].
47004 ms: Mark-sweep 1310.9 (1440.0) -> 1321.6 (1409.0) MB, 1501.7 / 0.0 ms [last resort gc].
48543 ms: Mark-sweep 1321.6 (1409.0) -> 1332.6 (1409.0) MB, 1539.4 / 0.0 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x1ed0af3cfb51 <JS Object>
1: createTypeReference [/Users/mv/dev/js/product-designer/node_modules/typescript/lib/typescript.js:~20534] [pc=0x1f1beb71ebba] (this=0x1ed0af3e6ee9 <JS Global Object>,target=0xaf18ff9b3a9 <a TypeObject with map 0x1b5c8ee7baf9>,typeArguments=0xf402c4ae0b1 <JS Array[1]>)
2: instantiateType [/Users/mv/dev/js/product-designer/node_modules/typescript/lib/typescript.js:~21234] [pc=0x1f1beb09...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/local/bin/iojs]
2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/iojs]
3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/iojs]
4: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/local/bin/iojs]
5: v8::internal::HashTable<v8::internal::SeededNumberDictionary, v8::internal::SeededNumberDictionaryShape, unsigned int>::EnsureCapacity(v8::internal::Handle<v8::internal::SeededNumberDictionary>, int, unsigned int, v8::internal::PretenureFlag) [/usr/local/bin/iojs]
6: v8::internal::SeededNumberDictionary::AddNumberEntry(v8::internal::Handle<v8::internal::SeededNumberDictionary>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, bool) [/usr/local/bin/iojs]
7: v8::internal::(anonymous namespace)::DictionaryElementsAccessor::AddImpl(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, unsigned int) [/usr/local/bin/iojs]
8: v8::internal::JSObject::AddDataElement(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow) [/usr/local/bin/iojs]
9: v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode) [/usr/local/bin/iojs]
10: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/iojs]
11: 0x1f1be94092a7
node: v6.5.0
webpack: 2.1.0-beta.20
typescript: tried both 2.0 and 2.0.2
os: OSX
Using versions of ATL prior to 2.2.1 does not seem to cause this error, however they do result in compile time errors due to improper support of @types
, so the fact that the tsc compile fails may be what prevents this from happening, can't say for sure. What i'm doing to provoke the error is to edit the same file over and over again, so maybe it's because the type checking does not get a chance to complete before making another change, and triggering a new build?
I've tried disabling the ForkChecker plugin with same result.