Skip to content

Compiler crashes when using a project with many project references #32676

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
KnisterPeter opened this issue Aug 2, 2019 · 4 comments
Closed
Assignees
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@KnisterPeter
Copy link
Contributor

TypeScript Version: 3.5.3

Search Terms: out-of-memory, tsc, project refrences, garbage collection

Code

There is not easy way to show this.
The tsc fails (node dies) with out of memory in a project with may project references.
There is a point where adding one more project reference makes the problem occur.

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

<--- Last few GCs --->

[31:0x559282ba6b40]   187820 ms: Mark-sweep 1391.0 (1425.4) -> 1391.0 (1425.4) MB, 716.4 / 0.0 ms  (average mu = 0.171, current mu = 0.002) allocation failure GC in old space requested
[31:0x559282ba6b40]   188622 ms: Mark-sweep 1391.0 (1425.4) -> 1391.0 (1425.4) MB, 649.6 / 0.0 ms  (average mu = 0.179, current mu = 0.190) last resort GC in old space requested


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x204e63c5be1d]
Security context: 0x399cfbb9e6e9 <JSObject>
    1: set [0x399cfbb91ea9](this=0x04ae4a499231 <Map map = 0xe6135f04359>,0x3730a06da439 <String[16]: @BENIGN_POSITIVE>,0x3730a06da461 <Type map = 0xe6135f55fa9>)
    2: getLiteralType(aka getLiteralType) [0x4ae4a4a1bb9] [/builds/xxx/node_modules/typescript/lib/tsc.js:~34353] [pc=0x204e64e603d6](this=0x08616aa826f1 <undefined>,value=0x0f68702fbf49 <Str...

error Command failed with signal "SIGABRT".

Expected behavior:

Project references should not increase memory usage that much.

Related Issues:

Could be related to #31398 (#31398 (comment))

@sheetalkamat
Copy link
Member

@KnisterPeter We need some more info about this. Please share the project where this repros so we can actually see this happening and can determine the course of action that needs to be taken.

@sheetalkamat sheetalkamat added the Needs More Info The issue still hasn't been fully clarified label Aug 2, 2019
@KnisterPeter
Copy link
Contributor Author

@sheetalkamat Sorry for my late answer. The project is private for a client of us, so unfortunately I could not give more insides.
I'm not sure how to create a minimal example for this since I guess it might require a critical mass.

Anything I could create (like memory dumps or stuff) which could help to debug this?

@sheetalkamat
Copy link
Member

You might want to try typescript@next to see if this is fixed for you.. #33145 might be the fix that you need. Otherwise there isn't much for us to base investigation on unless you provide a repro

@KnisterPeter
Copy link
Contributor Author

@sheetalkamat We switched to node 12 and its working now. That may be caused by the extended heap in node 12 and others.

Anyway, thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

2 participants