Skip to content

[4.0.0-rc.2] Typescript compiler runs out of memory when including ImmutableJS #1306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lwansbrough opened this issue Sep 17, 2017 · 2 comments

Comments

@lwansbrough
Copy link

lwansbrough commented Sep 17, 2017

Attempting to build my Typescript (2.5.2) project with any reference to ImmutableJS results in the following exception which happens consistently. Removing all imports referencing immutable fixes the problem. I can also confirm that immutable@3.8.1 works fine.

<--- Last few GCs --->

[11569:0x103801600]    60403 ms: Mark-sweep 1406.5 (1478.3) -> 1406.3 (1454.3) MB, 2374.6 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 2375 ms) last resort 
[11569:0x103801600]    62824 ms: Mark-sweep 1406.3 (1454.3) -> 1406.3 (1454.3) MB, 2420.2 / 0.0 ms  last resort 


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x2c905ff9bbd9 <JS Object>
    1: set [native collection.js:~247] [pc=0x367c5af95201](this=0x2868a401d1d9 <a Map with map 0x31b594c14319>,p=0x1b7ed42ec1b9 <String[7]: 1014798>,x=0x860110b9391 <a TypeObject with map 0x3137e4fa1839>)
    2: createTypeReference(aka createTypeReference) [node_modules/typescript/lib/typescript.js:~28759] [pc=0x367c5b0efe7f](this=0x2c905ff82...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 6: v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, v8::internal::JSMapIterator, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 7: v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, v8::internal::JSMapIterator, 2>::Rehash(v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/usr/local/bin/node]
 8: v8::internal::Runtime_MapGrow(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 9: 0x367c59f840bd
@sartaj10
Copy link

sartaj10 commented Sep 19, 2017

Apparently, they have merged the PR regarding this in Typescript and would be fixed in the 2.5.3 release
Here is more info regarding this

You could try installing the nightly release by following this and checking if it's working? - https://github.com/Microsoft/TypeScript/wiki/Nightly-drops

@leebyron
Copy link
Collaborator

Pretty wild!

This should be fixed by #1285 - but please report back and reopen if the master build (install from https://github.com/facebook/immutable-js/tree/npm) doesn't solve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants