gemini-cli - 💡(How to fix) Fix Memory Leak / High Memory Usage (7.46 GB) and Model Mismatch

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…
RAW_BUFFERClick to expand / collapse

What happened?

While running a Python-based trading bot (U-MILK) via Gemini CLI, I received a critical high memory usage warning: 7.46 GB.

Additionally, even though I configured the model_name as "gemini-1.5-flash" in my config.json, the CLI appears to be using "gemini-3.1-flash-lite-preview" or "gemini-3-flash-preview" as shown in the session stats.

I have attached the exported chat history JSON file to this issue for further investigation.

bug-report-history-1778348862179.json

What did you expect to happen?

  1. Stable memory consumption (expected to be well below 1 GB for this workload).
  2. The CLI should respect the model version specified in the configuration file.

Client information

  • CLI Version: 0.41.2
  • Git Commit: b0c7a1722
  • Session ID: 25ca165f-f2d9-4572-b2db-a0b59db15e6f
  • Operating System: win32 v24.15.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3.1-flash-lite-preview
  • Auth Type: gemini-api-key
  • Memory Usage: 197.4 MB
  • Terminal Name: Unknown
  • Terminal Background: Unknown
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

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 Memory Leak / High Memory Usage (7.46 GB) and Model Mismatch