Skip to content

[Bug] Severe process leak and hanging (Deadlock) when running multiple instances #23344

@jyongchul

Description

@jyongchul

Describe the bug
Recently, running multiple instances of the Gemini CLI (Antigravity) causes severe process leaks and complete hangs upon initialization. The CLI fails to terminate previous background processes, leading to massive memory consumption and eventual deadlocks.

To Reproduce

  1. Open multiple workspace directories.
  2. Run the CLI (gemini --yolo) in each directory simultaneously.
  3. Close and reopen some terminals.
  4. Attempt to open a new project. The CLI will hang indefinitely on startup.

Expected behavior
The CLI should cleanly terminate its Node.js and MCP server sub-processes when the session ends or is closed. Multiple instances should run independently without causing a system-wide deadlock.

System Information:

  • OS: Linux (Ubuntu via WSL2 on Windows)
  • Node/V8: Processes show up as node --no-warnings=DEP0040
  • Related MCPs: mcp-server-memory, mcp-server-filesystem, mcp-server-github are also left hanging as orphan processes.

Additional context (Diagnostic Output):
Running ps aux | grep gemini shows over 13+ orphaned node processes consuming 200MB~400MB of RAM each. The issue seems to have worsened in the most recent updates, indicating a regression in the teardown/cleanup logic of the CLI's core lifecycle or MCP process management.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitystatus/need-triageIssues that need to be triaged by the triage automation.status/possible-duplicate

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions