Skip to content

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

Closed
@KnisterPeter

Description

@KnisterPeter

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))

Metadata

Metadata

Assignees

Labels

Needs More InfoThe issue still hasn't been fully clarified

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions