gemini-cli - 💡(How to fix) Fix insanely large context after stopping to free ram [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#25688Fetched 2026-04-20 12:15:22
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1
RAW_BUFFERClick to expand / collapse

What happened?

I was using gemini cli and it was showing ~40% context, but was using 24G of ram. I shut down and restarted to free the ram, but when it restarted it showed >200% context and when I try to do /compress it says that it runs out of tokens before it is able to finish the compression

and apparely the bug report is too big to upload 186446635 Apr 20 00:57 bug-report-history-1776671837321.json

<!-- Failed to upload "bug-report-history-1776671837321.json" -->

[ACTION REQUIRED] 📎 PLEASE ATTACH THE EXPORTED CHAT HISTORY JSON FILE TO THIS ISSUE IF YOU FEEL COMFORTABLE SHARING IT.

What did you expect to happen?

memory and context management to keep working

Client information

  • CLI Version: 0.38.2
  • Git Commit: b0ed611a0
  • Session ID: 43b40c3f-f1a3-4fac-902a-db3225273963
  • Operating System: linux v22.22.1
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3-flash-preview
  • Auth Type: oauth-personal
  • Memory Usage: 2.55 GB
  • Terminal Name: VTE(8400)
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Unsupported

Login information

google account

Anything else we need to know?

No response

extent analysis

TL;DR

The issue can be mitigated by reducing the context size or splitting the compression process into smaller chunks to avoid running out of tokens.

Guidance

  • Verify the current context size and adjust it to a lower value to reduce memory usage and token consumption.
  • Try compressing smaller portions of the data at a time to avoid exceeding the token limit.
  • Check if there are any configuration options or flags in the gemini cli that can help optimize memory usage or token allocation.
  • Consider upgrading to a newer version of the gemini cli, if available, as the current version (0.38.2) may have known issues or limitations.

Example

No specific code snippet can be provided without more information about the gemini cli or its configuration options.

Notes

The provided information suggests a potential issue with memory management and token allocation in the gemini cli. However, without more details about the cli's configuration options or the specific commands used, it's difficult to provide a more targeted solution.

Recommendation

Apply workaround: Reduce context size or split compression into smaller chunks, as this approach can help mitigate the issue without requiring an upgrade or significant changes to the existing setup.

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 insanely large context after stopping to free ram [1 participants]