-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Typescript compiler hangs and starts eating memory #7344
Comments
what version of node do you use? |
v0.12.0 |
can you try to upgrade to node 5 and see if you still see this issue? |
Just checked with version 4.3.1 (LTS) and 5.7.0 (stable), problem is gone. I apparently had an ancient node version ... While running tsc, the process still peaks to 800Mb though (seems alot for such a small workload?) |
recent version of |
Darn ... the repo builds, but the project it was distilled from still explodes. I'll see if i can isolate the problem again. |
Can you share the actual code so we can be sure that root problem is addressed? We can sign an NDA if necessary. |
NDA is not necessary, but i prefer not to share it publicly. |
Can you send it to |
Sent! |
Same here, importing and using |
(present in TS 1.8.9, node 5.9.0) |
this is one of a few similar issues that were reported recently (i.e. #7460 and #7344) that originate from the fact that type declarations in rxjs-5.0.0-beta.2 got more complicated and compiler spends lots of time exploring them. This is one of downsides of structural type system - in order to prove that two types are related their whole structure must be examined. We can short-circuit in a few places (#7474) but in general this problem is pretty hard to solve. Luckily it can be addressed on the consumer side - we are following up with RxJS folks to add a fix that should improve the situation (ReactiveX/rxjs#1475) |
I forgot to mention that the hang happens on watch-triggered recompile. Initial build succeeds though (~2 sec slower than usual but still succeeds). Is it a known issue or should I post new one concerning successful initial but failed incremental? |
we've seen the similar issue before due to significant increase of memory during type relation check - it was resolved after I switched to RxJS version that included ReactiveX/rxjs#1475. Given that this PR is already merged in master ( 👏 ) you can try to build RxJS from master and see if it will help in your case. If issue still exist I'd be very curious if I can somehow get your project for repro to make sure that problem is addressed. |
Updating to latest RxJS beta should address the issue. please reopen if the issue persists on newer versions of the framework. |
TypeScript Version:
1.8.0-beta
Code
Expected behavior:
This code has compiled and worked before. (this is a snippet from an angular2 application: if an authenticated request fails because the token has expired, the code tries to use a refresh token to get a new token and retry the request).
Actual behavior:
The compiler starts to hang
I have stripped down my project to the bare minimum to illustrate the problem.
To reproduce; clone this repo:
https://github.com/davyvanlaere/TypescriptCompilerIssue
Then run "npm install", followed by "tsc": the compiler will hang, and the process "Evented I/O for V8 Javascript" will start to eat memory (i let it run for a while and killed it at 1.3gb).
It has something to do with the types of the return statements. If you the replace 2nd "return this.http.request(url, request);" line with "return Observable.throw(initialError);", the compiuler will not hang.
The text was updated successfully, but these errors were encountered: