davidmarkclements / 0x

🔥 single-command flamegraph profiling 🔥
MIT License
3.23k stars 106 forks source link

JavaScript heap out of memory #237

Closed drewdaemon closed 2 years ago

drewdaemon commented 3 years ago

I'm trying to use 0x to profile a build script that takes several minutes. It looks like the flame graph buffer pushes me over the memory limit. Would be nice if this work was done with a stream or at least if I had the option to pass v8's --max-old-space-size flag through.

🔥  Process exited, generating flamegraphbuffer
<--- Last few GCs --->

[69134:0x10280a000]   433654 ms: Mark-sweep 1396.1 (1426.9) -> 1395.9 (1423.4) MB, 1362.4 / 0.0 ms  (+ 0.0 ms in 9 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 1364 ms) (average mu = 0.052, current mu = 0.014) finaliz[69134:0x10280a000]   433658 ms: Scavenge 1396.5 (1423.4) -> 1396.4 (1427.4) MB, 2.5 / 0.0 ms  (average mu = 0.052, current mu = 0.014) allocation failure 

<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x3ad2d435be3d]
    1: StubFrame [pc: 0x3ad2d435d1ff]
Security context: 0x0d187049e6e9 <JSObject>
    2: /* anonymous */ [0xd184eb79b29] [/Users/andr9558/.config/yarn/global/node_modules/jsonparse/jsonparse.js:~92] [pc=0x3ad2d475fc76](this=0x0d18dfa82349 <Parser map = 0xd18d816d811>,buffer=0x0d18898513a9 <Uint8Array map = 0xd18fa2ba389>)
    3: /* anonymous */ [0xd18dfa82439] [/Users/andr9558/.config/yarn/global/node...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10003d041 node::Abort() [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 2: 0x10003d24b node::OnFatalError(char const*, char const*) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 3: 0x1001b8e25 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 4: 0x100586d82 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 5: 0x100589855 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 6: 0x1005856ff v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 7: 0x1005838d4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 8: 0x10059016c v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
 9: 0x1005901ef v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
10: 0x10055fb34 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
11: 0x1007e7e14 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/andr9558/.nvm/versions/node/v10.17.0/bin/node]
12: 0x3ad2d435be3d 
13: 0x3ad2d435d1ff 
Abort trap: 6
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity.