-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Compiler 1.8.2 hangs when building an array of two classes #7293
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
Hmm, isn't this regression introduced with 1.8 not going to be fixed in the 1.8 service release? |
We do not know much details about the issue yet, so i can not speculate about which release it will go in. |
|
Ouch:
I try it on my Windows machine (in a PowerShell), and it hangs (running for 5 minutes now, on a SP4).
|
Can you try to upgrade node on Windows machine to 5 and re-run the test? |
That works.
|
this is unfortunate. There were some changes in node 0.12 that significantly regressed performance of TypeScript compiler so this is a known issue. |
When running against my actual project, the process runs out of memory, though:
Here is the same using 1.7.5:
|
good point, let me check we've regressed |
I as able to avoid the problem in my code base: The array of types from the repro was reduced from my angular2 application and contains providers for several services. When I cast all the elements of the array to So with the equivalent of
I get this:
|
I've found the offending commit and now checking if we can partially revert its changes. |
Fix is checked in and should be available on today's nightly build: |
I'm running the version published to npm about 1 hour ago, if I understand the UTC timestamp correctly :-), but this doesn't fix this:
Again, casting the array members to
|
Using 1.8.2 or today's import {BehaviorSubject} from 'rxjs/Rx';
class Foo extends BehaviorSubject<string> { }
class type {
member: string; // remove me to gain 850MiB memory usage
}
class Bar extends BehaviorSubject<type> { }
var ARRAY = [Foo,Bar]; With
Without
|
I've checked and seems that today's |
Wheee!
I had to go back a few commits in my code to make it actually crash with 1.8.7. I had changed the contents of the offending array besides the The 800MiB from my previous post have been reduced to 400MiB with this new nightly (70067K with I'd like to convince you (and @mhegazy) to put the fix in a service release. Not because it's hitting many people, but because the default Visual Studio experience (with Node 0.12.2) is just incredibly bad when you run into this and the changes in a code base are quite subtle to trigger it. Node 0.12.2 seems to not handle OOMs well and keeps running and VS just crashes out of thin air. |
#7372 ports this fix to the next point release |
Wonderful. Thanks! |
closing, since the fix is checked-in. |
just killed a day with this problem (out of memory) |
+1 |
Ok, so I get this error using tsc 1.8.9 with Node 4 or Node 5.9, but not with Node 5.0 |
TypeScript Version:
1.8.2
Code
The
BehaviorSubject
is a requirement, just using a local, generic class makes it work. I haven't tried further reducing the base class. Once you comment out one of the two array members, the compiler doesn't hang anymore.Here is my
package.json
snippet:The text was updated successfully, but these errors were encountered: