TypeScript: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
TypeScript Version: nightly (2.6.0-dev.20170912)
Code
{
"compilerOptions": {
"module": "system",
"jsx": "react",
"target": "es5",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"newLine": "lf",
"allowJs": false,
"noImplicitAny": true,
"baseUrl": "./",
"noEmitOnError": true,
"sourceMap": true,
"alwaysStrict": true,
"inlineSourceMap": false,
"paths": {
"*": [
"node_modules/@types/*"
]
},
"lib": [
"dom",
"es2015",
"es5"
]
}
}
07:28:49 - File change detected. Starting incremental compilation...
<--- Last few GCs --->
[1592:000002842FE68000] 7027823 ms: Mark-sweep 1401.5 (1465.4) -> 1401.5 (1465.4) MB, 4599.6 / 0.0 ms last resort
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0000033CF2C1CEA9 <JSObject>
1: set [native collection.js:~247] [pc=000000C2A8FE6697](this=000000F425FBE6F1 <Map map = 000003AA6FD983B9>,p=000003A9ED17AB21
<String[9]: @Telefone>,x=000003A9ED17AB51 <Type map = 000003AA6FDC6CF9>)
2: getLiteralType(aka getLiteralType) [C:\nodejs\node_modules\typescript\lib\tsc.js:~24883] [pc=000000C2A8D93E76](this=0000033C
F2C02241 <undefined>,value=000000CEC1A9C961 <String[8]: Telef...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
Expected behavior:
Not crash
Actual behavior:
TS in watch mode is randomly crashing with the above stacktrace. I can’t figure out what is making it crash. I’m using vscode, but the watch mode is tsc -w -p tsconfig.json
per @sandersn recommendation (in https://github.com/Microsoft/TypeScript/issues/17112#issuecomment-328902121) opening a new issue about the same error name, but different stack
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 43 (19 by maintainers)
@pocesar Wanted to make sure you are using the latest build. While i tried to repro this on larger code base, I noticed that in --diagnostics mode there is too much logging on the command line. Did you notice that? (The fix for that would be in PR #18970). Also I did not see explosion in memory. The memory usage is more than previous version but memory isn’t leaking and is being collected. Ex here are the memory numbers I saw on few larger code bases:
--strictin 2.6 adds a new--strictFunctionTypes, setting this to false should return you to the 2.5.3--strictbehavior.yes please.
Same error here .