Skip to content

macOS: git-ai can consume >20 GB memory during git pull #1677

Closed

Description

@peckfly

Summary

On macOS, the git-ai process may consume extremely high memory while pulling the latest code.

Observed behavior

During a code pull/update flow, Activity Monitor showed the git-ai process using about 21.17 GB of memory. This appears high enough to severely impact the machine.

Reproduction

  1. Switch to a relatively old branch. It does not have to be a very old branch.
  2. Run a pull/update to get the latest code.
  3. Observe git-ai memory usage on macOS.

Expected behavior

git-ai should keep memory usage bounded during git pull / fetch / merge operations, even when processing many changed files or trace events.

Notes

  • Platform: macOS
  • Screenshot evidence: Activity Monitor showed git-ai at approximately 21.17 GB memory usage.
  • This may be related to pull/fetch/merge handling, trace2 ingestion, rewrite tracking, or processing a larger diff/history range, but I have not confirmed the exact cause yet.
Image

@svarlamov

Activity

  1. Siddhant-K-code commented on Jun 30, 2026

    @Siddhant-K-code
    Contributor

    Thanks for reporting this, we're aware of the issue. We've had another user report similar memory behavior and are actively investigating. We're currently gathering concrete metrics to validate the root cause & measure the fix before shipping it.

    A couple of questions to help us narrow this down:

    1. How many changed files / commits were involved in the pull? (rough estimate is fine)
    2. Which tool do you use Cursor, Copilot, Claude Code, or another AI coding tool alongside git-ai?
    3. Was this the first git pull after installing git-ai, or does it happen on subsequent pulls too?
    4. What git-ai version are you on? (git-ai --version)

    Appreciate the report and the screenshot, very helpful! ❤️

  2. Siddhant-K-code commented on Jun 30, 2026

    @Siddhant-K-code
    Contributor

    Could you run these and share the output? It'll help us pinpoint the cause:

    # 1. Version
    git-ai --version
    
    # 2. Internal file permissions & sizes
    ls -la ~/.git-ai/internal/
    
    # 3. AI tool transcript sizes
    for dir in ~/.cursor ~/.codex ~/.claude ~/.windsurf ~/.amp ~/.continue ~/.gemini; do
      [ -d "$dir" ] && echo "$dir: $(du -sh "$dir" 2>/dev/null | cut -f1)"
    done
    
    # 4. Metrics DB size
    ls -lh ~/.git-ai/internal/metrics-db

    Also:

    • Was git-ai installed with sudo?
      ls -la $(which git-ai) ~/.git-ai/
      
      If the 3rd column shows root instead of your username, it was likely installed with sudo.

    Thanks!

  3. svarlamov commented on Jun 30, 2026

    @svarlamov
    Member

    @peckfly Do you have a chance to share the above before you head off for the evening?

  4. peckfly commented on Jun 30, 2026

    @peckfly
    ContributorAuthor

    git-ai --version

    1.6.3

    ls -la ~/.git-ai/internal/

    total 780000
    drwxr-xr-x@ 18 user staff 576 Jun 30 12:19 .
    drwxr-xr-x@ 22 user staff 704 Jun 17 18:43 ..
    -rw-r--r--@ 1 user staff 6148 May 27 00:38 .DS_Store
    -rw-r--r--@ 1 user staff 1306624 Jun 30 18:13 bash-checkpoints-db
    -rw-r--r--@ 1 user staff 32768 Jun 30 12:31 bash-checkpoints-db-shm
    -rw-r--r--@ 1 user staff 4140632 Jun 30 21:03 bash-checkpoints-db-wal
    drwxr-xr-x@ 7 user staff 224 Jun 30 12:19 daemon
    -rw-r--r--@ 1 user staff 16556032 May 13 18:39 db
    -rw-r--r--@ 1 user staff 32768 May 14 19:26 db-shm
    -rw-r--r--@ 1 user staff 164713512 May 14 18:44 db-wal
    -rw-r--r--@ 1 user staff 36 Apr 7 20:26 distinct_id
    -rw-r--r--@ 1 user staff 191078400 Jun 30 18:06 metrics-db
    -rw-r--r--@ 1 user staff 32768 Jun 29 16:50 metrics-db-shm
    -rw-r--r--@ 1 user staff 8639672 Jun 30 21:19 metrics-db-wal
    -rw-r--r--@ 1 user staff 147456 Jun 30 12:19 transcripts-db
    -rw-r--r--@ 1 user staff 32768 Jun 30 12:19 transcripts-db-shm
    -rw-r--r--@ 1 user staff 725152 Jun 30 21:19 transcripts-db-wal
    -rw-r--r--@ 1 user staff 94 Jun 30 12:19 update_check

    AI tool transcript sizes

    /Users/user/.cursor: 573M
    /Users/user/.codex: 2.6G
    /Users/user/.claude: 16M

    Metrics DB size

    -rw-r--r--@ 1 user staff 182M Jun 30 18:06 /Users/user/.git-ai/internal/metrics-db @svarlamov @Siddhant-K-code

  5. added 2 commits that reference this issue on Jun 30, 2026
  6. svarlamov commented on Jun 30, 2026

    @svarlamov
    Member

    @peckfly Sorry to hear that you ran into this, and we should, between 1.6.6 and 1.6.7 (latest) have addressed this issue

  7. svarlamov commented on Jul 1, 2026

    @svarlamov
    Member

    v1.6.8 should be even more complete

  8. Siddhant-K-code commented on Jul 1, 2026

    @Siddhant-K-code
    Contributor

    Once again, thanks @peckfly for reporting this, really appreciated ❤️

    Let us know, if you notice any other problems!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions