gemini-cli - 💡(How to fix) Fix Node.js Heap Out of Memory Crash During Gemini Execution [1 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#27291Fetched 2026-05-20 03:59:20
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

Error Message

Gemini crashes with a fatal Node.js heap out of memory error during execution. The process eventually exceeds the V8 heap limit and terminates. Error Logs FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

RAW_BUFFERClick to expand / collapse

What happened?

Gemini crashes with a fatal Node.js heap out of memory error during execution. The process eventually exceeds the V8 heap limit and terminates.

This appears to happen during heavy processing or long-running operations.

Error Logs <--- Last few GCs --->

[336597:0x29cebef0] 14360037 ms: Mark-Compact 1979.5 (2084.0) -> 1965.8 (2083.2) MB, 148.16 / 0.12 ms (average mu = 0.314, current mu = 0.286) allocation failure; scavenge might not succeed [336597:0x29cebef0] 14360227 ms: Mark-Compact 1987.2 (2088.8) -> 1969.5 (2087.7) MB, 142.93 / 0.00 ms (average mu = 0.283, current mu = 0.247) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

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

1: 0xb78db3 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/bin/node] 2: 0xee8300 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/bin/node] 3: 0xee85e7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/bin/node] 4: 0x10fb205 [/usr/bin/node] 5: 0x10fb794 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/bin/node] 6: 0x1112684 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/usr/bin/node] 7: 0x1112e9c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node] 8: 0x116bc5c v8::internal::MinorGCJob::Task::RunInternal() [/usr/bin/node] 9: 0xd32ad6 [/usr/bin/node] 10: 0xd3607f node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/usr/bin/node] 11: 0x18abb83 [/usr/bin/node] 12: 0x18c05fb [/usr/bin/node] 13: 0x18ac8a7 uv_run [/usr/bin/node] 14: 0xbbbbe6 node::SpinEventLoopInternal(node::Environment*) [/usr/bin/node] 15: 0xd069e1 node::NodeMainInstance::Run() [/usr/bin/node] 16: 0xc6853f node::Start(int, char**) [/usr/bin/node] 17: 0x7f5e71318ca8 [/lib/x86_64-linux-gnu/libc.so.6] 18: 0x7f5e71318d65 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6] 19: 0xbb835e _start [/usr/bin/node]

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

What did you expect to happen?

Gemini should complete execution without exhausting the Node.js heap memory.

Client information

  • CLI Version: 0.21.2
  • Git Commit: 97eab144b
  • Session ID: af470ab8-61b7-49a6-b13d-8cfe8edce105
  • Operating System: linux v20.20.2
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Memory Usage: 260.3 MB
  • IDE Client: IDE

Login information

No response

Anything else we need to know?

The crash appears related to excessive memory consumption or a potential memory leak during Gemini processing. Increasing the Node.js heap size may temporarily delay the crash, but does not fully resolve the issue.

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