-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Upgrading to 2.4.1 runs out of memory. #17097
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
Comments
I have an app which demonstrates this error also. (node v8.1.2, tsc 2.4.1) |
I run into the same issue and switching to 2.4.0 enables me to continue to work. |
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory |
If that might help fixing the problem - I have a public repository that is affected: https://github.com/arturkulig/immview |
FWIW, I was able to solve this in my project by changing all genericized callable types to interfaces. According to HerringtonDarkholme, types are not cached, whereas interfaces are. TL;DR: typing that caused >= 2.4.1 to OOM: type Typename = <T>(arg: Argtype<T>) => void; fixed for >= 2.4.1: interface Typename<T> {
(arg: Argtype<T>): void
} |
* s/String/string * s/Object/object * replaced callable genericized types with interfaces (see microsoft/TypeScript#17097 (comment) * coallesced some method calls where union types made sense * replace Function with `() => void` * tslint fixed a bunch of missing semicolons
Get Attached shell output from running tsc on those 3 versions Environment is Windows7, 32GB RAM |
@mulyoved see my post above for a workaround. |
@mceachen thanks, does not help my case, don't have such types in my code |
@mulyoved If you add |
@arturkulig a couple of workarounds for immview while I investigate it: --noStrictGenericChecks returns compile time to around a second. I also tried changing most of the type aliases in Types.ts to interfaces, which reduces compile times to around ten seconds. Overall, the culprit is the added checking we do in 2.4.1, which exposes bugs and architectural weaknesses that were already there. I'll see if I can find anything specific using immview as a test case. |
@sandersn running with I guess my case is different from this issue, not sure why tsc need more memory, not a big project |
@mulyoved what about 2.4.0? (If you don't have time, I'll be in contact shortly to see if you can share your code with me privately so I can continue debugging.) |
Actually @arturkulig if you change only |
@sandersn yes fail also with 2.4.0, (I just sent the code in email) |
seem my problem was related to paypal/glamorous#288 upgrade to latest version of glamorous solved the problem and I see a reduction of 10x in memory used 30x in the number of symbols |
@sandersn FYI |
I updated
|
@aj0strow this looks like a different issue. can you please file a new one for it, and give us the source file that it triggers the crash. |
The crash @mulyoved observed when using glamorous is very likely from glamorous' use of |
I've had to revert back to 2.3.2 to get my builds to work. Any idea when this release will be available? |
@electricessence 2.5.3 has the fix. |
I tried upgrading typescript versions from
2.3.4
to2.4.1
. Now it runs out of memory.I don't know how to debug running out of memory. Happy to spend time trying things out and reporting back if there's specific tests that would be interesting or helpful.
TypeScript Version: 2.4.1
Node Version: 6.7.0
Code
// A *self-contained* demonstration of the problem follows...
It's a large project, not sure what is causing the problem.
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: