gemini-cli - 💡(How to fix) Fix previous session crashed due to heap memory [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26459Fetched 2026-05-05 06:03:32
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×1labeled ×1

Error Message

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

RAW_BUFFERClick to expand / collapse

What happened?

I asked Gemini to look at a CSV and count the unique email addresses. The CSV was only 168 KB, but resulted in high memory and heap crash below. I previously pasted the csv contents into the Gemini console and it began running sluggishly (never returned correctly). So the 2nd request to read the CSV file may not have been the only trigger.


High memory usage detected: 13.42 GB. If you experience a crash, please file a bug report by running /bug

╭──────────────────────────────────────────────────────────────────────────────────────────╮ │ ✓ Shell cut -d',' -f2 "/Users/trobbins/Downloads/Zscaler members_2026-05-01T00:01:00.0… │ │ │ │ 113 │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯

✦ There are 113 unique emails in the file Zscaler members_2026-05-01T00:01:00.093172756Z.csv found in your Downloads folder.

                                                                            ? for shortcuts

──────────────────────────────────────────────────────────────────────────────────────────────── auto-accept edits Shift+Tab to plan 3 GEMINI.md files · 5 MCP servers · 18 skills ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

Type your message or @path/to/file <--- Last few GCs --->▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ workspace (/directory) sandbox /model quota [7445:0x94540c000] 261066447 ms: Mark-Compact 24155.0 (24613.4) -> 24145.4 (24619.8) MB, pooled: 0 MB, 12518.04 / 0.00 ms (average mu = 0.152, current mu = 0.003) allocation failure; scavenge might not succeed [7445:0x94540c000] 261086223 ms: Mark-Compact 24163.8 (24622.2) -> 24156.6 (24630.8) MB, pooled: 0 MB, 19715.62 / 0.00 ms (average mu = 0.060, current mu = 0.003) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory ----- Native stack trace -----

1: 0x103964e80 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 2: 0x103b56904 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 3: 0x103cf305c v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 4: 0x103cf0e1c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 5: 0x103ce9940 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::interna 20: 0x103b6bd10 v8::Function::Call(v8::Localv8::Context, v8::Localv8::Value, int, v8::Local 6: 0x103cdcac4 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 7: 0x103f6f388 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 8: 0x10376a19c Builtins_WasmCEntry [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 9: 0x1038390c8 Builtins_StringToLowerCaseIntl [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 10: 0x10f568048 11: 0x1036d1dc8 construct_stub_create_deopt_addr [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 12: 0x10eb8e6fc 13: 0x10e090948 14: 0x10e9b2da8 15: 0x10e85f570 16: 0x1036d2c0c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 17: 0x1036d28f4 Builtins_JSEntry [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 18: 0x103c6e180 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 19: 0x103c6dadc v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, int, v8::internal::Handlev8::internal::Object) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 20: 0x103b6bd10 v8::Function::Call(v8::Localv8::Context, v8::Localv8::Value, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 21: 0x10388ff90 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@22/22.22.2/lib/libnode.127.dylib] 22: 0x1038a4f80 node::AsyncWrap::MakeCallback(v8::Localv8::Function, int, v8::Localv8::Value) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 23: 0x10396b4bc node::fs::FSReqCallback::Resolve(v8::Localv8::Value) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 24: 0x10396dc74 node::fs::AfterScanDir(uv_fs_s*) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 25: 0x10395bb58 node::MakeLibuvRequestCallback<uv_fs_s, void ()(uv_fs_s)>::Wrapper(uv_fs_s*) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 26: 0x100c46e64 uv__work_done [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib] 27: 0x100c4a3cc uv__async_io [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib] 28: 0x100c591b0 uv__io_poll [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib] 29: 0x100c4ab64 uv_run [/opt/homebrew/Cellar/libuv/1.52.1/lib/libuv.1.0.0.dylib] 30: 0x103890850 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 31: 0x1039abd3c node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 32: 0x1039aba88 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 33: 0x103925908 node::Start(int, char**) [/opt/homebrew/Cellar/node@22/22.22.2/lib/libnode.127.dylib] 34: 0x1873bbda4 start [/usr/lib/dyld]

What did you expect to happen?

Read the csv, give me results, don't crash.

Client information

  • CLI Version: 0.40.1
  • Git Commit: 7a382e066
  • Session ID: 1516d206-fe7d-4ddd-aeb8-5d0bf8e75e55
  • Operating System: darwin v22.22.2
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 1.91 GB
  • Terminal Name: tmux 3.6a
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Unsupported

Login information

Google Account (corporate)

Anything else we need to know?

No response

extent analysis

TL;DR

Increase the heap size or optimize the memory usage of the application to prevent the JavaScript heap out of memory error.

Guidance

  • The error message "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory" indicates that the application has exceeded the maximum allowed heap size.
  • The high memory usage detected (13.42 GB) suggests that the application is consuming a large amount of memory, which could be due to the processing of the CSV file.
  • To mitigate this issue, you can try increasing the heap size by setting the --max-old-space-size flag when running the Node.js application.
  • Alternatively, you can optimize the memory usage of the application by processing the CSV file in chunks or using a more memory-efficient algorithm.

Example

No code example is provided as the issue is related to memory usage and heap size, which is a configuration or optimization problem rather than a code-specific issue.

Notes

The exact solution may depend on the specific requirements and constraints of the application, such as the available memory and the size of the CSV files being processed.

Recommendation

Apply a workaround by increasing the heap size using the --max-old-space-size flag, as this is a quicker solution than optimizing the memory usage of the application.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

gemini-cli - 💡(How to fix) Fix previous session crashed due to heap memory [1 comments, 2 participants]