gemini-cli - 💡(How to fix) Fix fatal error again! [2 comments, 3 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#25575Fetched 2026-04-18 05:57:49
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2closed ×1

Error Message

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

RAW_BUFFERClick to expand / collapse

What happened?

<--- Last few GCs --->▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ workspace (/directory) branch sandbox /model [1024539:0x8190b30] 14979543 ms: Mark-Compact 1666.8 (1832.3) -> 1658.6 (1831.9) MB, 230.14 / 0.10 ms (average mu = 0.966, current mu = 0.981) allocation failure; scavenge might not succeed [1024539:0x8190b30] 14980017 ms: Mark-Compact 1674.3 (1831.9) -> 1672.6 (1861.9) MB, 407.22 / 0.00 ms (average mu = 0.913, current mu = 0.140) allocation failure; scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached 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: 0x1113088 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node] 6: 0x10e91f1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node] 7: 0x10ea385 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node] 8: 0x10c69a6 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/bin/node] 9: 0x10b8304 v8::internal::FactoryBasev8::internal::Factory::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/usr/bin/node] 10: 0x10bb667 v8::internal::FactoryBasev8::internal::Factory::NewRawTwoByteString(int, v8::internal::AllocationType) [/usr/bin/node] 11: 0x157b0dc v8::internal::IncrementalStringBuilder::Extend() [/usr/bin/node] 12: 0x1238171 v8::internal::JsonStringifier::SerializeString(v8::internal::Handlev8::internal::String) [/usr/bin/node] 13: 0x1239711 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 14: 0x123af49 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 15: 0x123d6c9 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 16: 0x123a134 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 17: 0x123d6c9 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 18: 0x123a134 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 19: 0x123d6c9 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handlev8::internal::Object, bool, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 20: 0x123e4b6 v8::internal::JsonStringify(v8::internal::Isolate*, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object, v8::internal::Handlev8::internal::Object) [/usr/bin/node] 21: 0xf7ac32 v8::internal::Builtin_JsonStringify(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node] 22: 0x195e376 [/usr/bin/node]

What did you expect to happen?

it was mid task, i expected it to finish its task

Client information

  • CLI Version: 0.38.1
  • Git Commit: 7f5580034
  • Session ID: 25c3d170-b023-4318-8ad8-fbb6ec8ea0e9
  • Operating System: linux v20.20.2
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 180.4 MB
  • Terminal Name: Unknown
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The application has run out of memory, causing a fatal error, and increasing the Node.js heap size may help resolve the issue.

Guidance

  • The error message "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory" indicates that the Node.js process has exceeded its allocated memory limit.
  • To verify the issue, check the memory usage of the application and look for any memory leaks or inefficient memory allocation.
  • Consider increasing the Node.js heap size by using the --max-old-space-size flag when running the application, for example: node --max-old-space-size=4096 your-application.js.
  • Monitor the application's memory usage after increasing the heap size to ensure it does not continue to exceed the new limit.

Example

No code snippet is provided as the issue is related to memory allocation and not a specific code block.

Notes

Increasing the heap size may only be a temporary solution, and it is recommended to investigate and address any underlying memory leaks or inefficient memory allocation in the application.

Recommendation

Apply workaround: Increase the Node.js heap size using the --max-old-space-size flag to prevent the application from running out of memory. This will allow the application to continue running, but it is recommended to investigate and address any underlying memory issues.

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