Skip to content

Memory allocation failure with TS 5.3.1-rc #56470

Closed
@akwodkiewicz

Description

@akwodkiewicz

🔎 Search Terms

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

"gc", "out-of-memory", "heap", "memory", "RAM", "garbage collector"

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 5.3.0-beta and 5.3.1-rc

⏯ Playground Link

No response

💻 Code

Actually, the console output

/Users/akwodkiewicz/my-project/node_modules/typescript/bin/tsc

<--- Last few GCs --->

[52246:0x138040000]    84895 ms: Mark-sweep 4042.1 (4131.9) -> 4026.8 (4132.6) MB, 1460.0 / 0.0 ms  (average mu = 0.139, current mu = 0.004) allocation failure; scavenge might not succeed
[52246:0x138040000]    86325 ms: Mark-sweep 4042.5 (4132.6) -> 4027.6 (4133.1) MB, 1424.5 / 0.0 ms  (average mu = 0.076, current mu = 0.004) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x102e2bc40 node::Abort() [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 2: 0x102e2be24 node::ModifyCodeGenerationFromStrings(v8::Local<v8::Context>, v8::Local<v8::Value>, bool) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 3: 0x102f83608 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 4: 0x10312deec v8::internal::EmbedderStackStateScope::EmbedderStackStateScope(v8::internal::Heap*, v8::internal::EmbedderStackStateScope::Origin, cppgc::EmbedderStackState) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 5: 0x103131ad8 v8::internal::Heap::CollectSharedGarbage(v8::internal::GarbageCollectionReason) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 6: 0x10312eaec v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*, v8::GCCallbackFlags) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 7: 0x10312bdec v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 8: 0x103120928 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
 9: 0x10312116c v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
10: 0x1031070ec v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
11: 0x1034a780c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
12: 0x1037f504c Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
13: 0x1037cb300 Builtins_MapConstructor [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
14: 0x10377d914 Builtins_JSBuiltinsConstructStub [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
15: 0x108f33890
16: 0x1094e75fc
17: 0x109cb4838
18: 0x10870cdc8
19: 0x10380a7d8 Builtins_ArrayForEach [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
20: 0x109b5cbc4
21: 0x109b5b524
22: 0x1099d71d8
23: 0x108dafca4
24: 0x109958dd0
25: 0x108fd0708
26: 0x109bddd48
27: 0x109beb270
28: 0x109b5cf14
29: 0x109b5b524
30: 0x1099d71d8
31: 0x108dafca4
32: 0x109958dd0
33: 0x108fd0708
34: 0x109bddd48
35: 0x109beb270
36: 0x109b5cf14
37: 0x109b5b524
38: 0x1099d71d8
39: 0x108dafca4
40: 0x109958dd0
41: 0x108fd0708
42: 0x109bddd48
43: 0x109beb270
44: 0x109b5cf14
45: 0x109b5b524
46: 0x1099d71d8
47: 0x108dafca4
48: 0x108e6ac9c
49: 0x108e6a744
50: 0x108e6ae14
51: 0x10912b4f0
52: 0x1090dc504
53: 0x1090c9cc8
54: 0x108ad47e8
55: 0x109129384
56: 0x1092e5adc
57: 0x1092482d0
58: 0x108ad47e8
59: 0x108e1b260
60: 0x1090eeb30
61: 0x1091a8b08
62: 0x109232010
63: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
64: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
65: 0x109562afc
66: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
67: 0x10956289c
68: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
69: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
70: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
71: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
72: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
73: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
74: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
75: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
76: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
77: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
78: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
79: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
80: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
81: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
82: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
83: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
84: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
85: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
86: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
87: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
88: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
89: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
90: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
91: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
92: 0x103780198 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
93: 0x10377e4d0 Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
94: 0x10377e164 Builtins_JSEntry [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
95: 0x1030afd68 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
96: 0x1030af2a8 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
97: 0x102f9f4a8 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
98: 0x102e98348 node::Realm::ExecuteBootstrapper(char const*, std::__1::vector<v8::Local<v8::Value>, std::__1::allocator<v8::Local<v8::Value>>>*) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
99: 0x102df59dc node::StartExecution(node::Environment*, char const*) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
100: 0x102df593c node::StartExecution(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
101: 0x102d74708 node::LoadEnvironment(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
102: 0x102e68820 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
103: 0x102df86a4 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
104: 0x102df895c node::Start(int, char**) [/opt/homebrew/Cellar/nvm/0.39.1/versions/node/v18.18.2/bin/node]
105: 0x184559058 start [/usr/lib/dyld]
[1]    52246 abort      /Users/akwodkiewicz/my-project/node_modules/typescript/bin/tsc

🙁 Actual behavior

JS OOM crash after around 1m 30s

🙂 Expected behavior

Successful compilation in around 60s (that's the time it takes to compile the project with 5.3.0-beta).

Additional information about the issue

Node: 18.18.2
NVM: 0.39.1
Yarn: 4.0.1

typescript used in the project is patched by Yarn, so the actual version is:
typescript@patch:typescript@npm%3A5.3.1-rc#optional!builtin<compat/typescript>::version=5.3.1-rc&hash=29ae49

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions