Summary
The command crashes when processing large code sections due to excessive memory usage. Node.js eventually reaches its heap limit and terminates with a JavaScript heap out of memory error, preventing the task from completing.
Expected Behavior
It should be continue working
Actual Behavior
<--- Last few GCs --->
[52731:0xb6740c000] 86117692 ms: Mark-Compact 4091.7 (4099.6) -> 4090.0 (4099.8) MB, pooled: 0.0 MB, 682.06 / 0.01 ms (average mu = 0.106, current mu = 0.001) allocation failure; scavenge might not succeed
[52731:0xb6740c000] 86118359 ms: Mark-Compact (reduce) 4094.0 (4101.8) -> 4091.0 (4097.8) MB, pooled: 0.0 MB, 172.22 / 0.00 ms (+ 305.2 ms in 63 steps since start of marking, biggest step 5.1 ms, walltime since start of marking 487 ms) (average mu = 0.191
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x1078d2b14 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
2: 0x106c5dcc8 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
3: 0x106c5dc80 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
4: 0x106e08c7c v8::internal::Heap::ShouldOptimizeForLoadTime() const [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
5: 0x106e0b21c v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
6: 0x106e0b0c4 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
7: 0x106e184f4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck)::$_1::operator()() const [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
8: 0x106e18198 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck)::$_1>(heap::base::Stack*, void*, void const*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
9: 0x10742bb54 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
10: 0x106e07304 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
11: 0x106dff834 std::__1::__invoke_result_impl<void, v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>::type v8::internal::HeapAllocator::CollectGarbageAndRetryAllocation<v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>(v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
12: 0x106dfe6a0 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
13: 0x106de6de0 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
14: 0x1070f272c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
15: 0x106765734 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
16: 0x132fd50ac
17: 0x132cc8148
18: 0x1329bc460
19: 0x132ea25ec
20: 0x1331cf2e0
21: 0x133119c24
22: 0x132d824b0
23: 0x132ff19f8
24: 0x132d8f5b0
25: 0x132fd8d50
26: 0x1066c296c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
27: 0x1066c2610 Builtins_JSEntry [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
28: 0x106d73e30 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
29: 0x106d73814 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandlev8::internal::Object, v8::internal::DirectHandlev8::internal::Object, v8::base::Vector<v8::internal::DirectHandlev8::internal::Object const>) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
30: 0x107976074 v8::Function::Call(v8::Isolate*, v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
31: 0x1068a41a0 node::InternalMakeCallback(node::Environment, v8::Localv8::Object, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context, v8::Localv8::Value) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
32: 0x1068a446c node::InternalMakeCallback(v8::Isolate, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context, v8::Localv8::Value) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
33: 0x1078b55fc node::Environment::CheckImmediate(uv_check_s) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
34: 0x1026a824c uv__run_check [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib]
35: 0x1026a2b94 uv_run [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib]
36: 0x1068a4ed0 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
37: 0x10697637c node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
38: 0x1069760b0 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
39: 0x106919b98 node::Start(int, char**) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
40: 0x19968dd54 start [/usr/lib/dyld]
zsh: abort cmd
Steps to reproduce the issue
I run it for 4 hour straight and I do several /clear for each section (maybe 7-8 section for that 4 hours)
Command Code Version
v0.33.4
Operating System
macOS
Terminal/IDE
ghostly
Shell
zsh
Additional context
No response
Summary
The command crashes when processing large code sections due to excessive memory usage. Node.js eventually reaches its heap limit and terminates with a JavaScript heap out of memory error, preventing the task from completing.
Expected Behavior
It should be continue working
Actual Behavior
<--- Last few GCs --->
[52731:0xb6740c000] 86117692 ms: Mark-Compact 4091.7 (4099.6) -> 4090.0 (4099.8) MB, pooled: 0.0 MB, 682.06 / 0.01 ms (average mu = 0.106, current mu = 0.001) allocation failure; scavenge might not succeed
[52731:0xb6740c000] 86118359 ms: Mark-Compact (reduce) 4094.0 (4101.8) -> 4091.0 (4097.8) MB, pooled: 0.0 MB, 172.22 / 0.00 ms (+ 305.2 ms in 63 steps since start of marking, biggest step 5.1 ms, walltime since start of marking 487 ms) (average mu = 0.191
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0x1078d2b14 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
2: 0x106c5dcc8 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
3: 0x106c5dc80 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
4: 0x106e08c7c v8::internal::Heap::ShouldOptimizeForLoadTime() const [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
5: 0x106e0b21c v8::internal::Heap::OldGenerationConsumedBytes() const [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
6: 0x106e0b0c4 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector, v8::base::TimeTicks) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
7: 0x106e184f4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck)::$_1::operator()() const [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
8: 0x106e18198 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck)::$_1>(heap::base::Stack*, void*, void const*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
9: 0x10742bb54 PushAllRegistersAndIterateStack [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
10: 0x106e07304 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags, v8::internal::PerformHeapLimitCheck) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
11: 0x106dff834 std::__1::__invoke_result_impl<void, v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>::type v8::internal::HeapAllocator::CollectGarbageAndRetryAllocation<v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&>(v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint)::$_0&, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
12: 0x106dfe6a0 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment, v8::internal::AllocationHint) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
13: 0x106de6de0 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
14: 0x1070f272c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
15: 0x106765734 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
16: 0x132fd50ac
17: 0x132cc8148
18: 0x1329bc460
19: 0x132ea25ec
20: 0x1331cf2e0
21: 0x133119c24
22: 0x132d824b0
23: 0x132ff19f8
24: 0x132d8f5b0
25: 0x132fd8d50
26: 0x1066c296c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
27: 0x1066c2610 Builtins_JSEntry [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
28: 0x106d73e30 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
29: 0x106d73814 v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::DirectHandlev8::internal::Object, v8::internal::DirectHandlev8::internal::Object, v8::base::Vector<v8::internal::DirectHandlev8::internal::Object const>) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
30: 0x107976074 v8::Function::Call(v8::Isolate*, v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
31: 0x1068a41a0 node::InternalMakeCallback(node::Environment, v8::Localv8::Object, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context, v8::Localv8::Value) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
32: 0x1068a446c node::InternalMakeCallback(v8::Isolate, v8::Localv8::Object, v8::Localv8::Function, int, v8::Localv8::Value, node::async_context, v8::Localv8::Value) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
33: 0x1078b55fc node::Environment::CheckImmediate(uv_check_s) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
34: 0x1026a824c uv__run_check [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib]
35: 0x1026a2b94 uv_run [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib]
36: 0x1068a4ed0 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
37: 0x10697637c node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
38: 0x1069760b0 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
39: 0x106919b98 node::Start(int, char**) [/opt/homebrew/Cellar/node/25.9.0_2/lib/libnode.141.dylib]
40: 0x19968dd54 start [/usr/lib/dyld]
zsh: abort cmd
Steps to reproduce the issue
I run it for 4 hour straight and I do several /clear for each section (maybe 7-8 section for that 4 hours)
Command Code Version
v0.33.4
Operating System
macOS
Terminal/IDE
ghostly
Shell
zsh
Additional context
No response