Skip to content

Memory leak: 2GB RAM after ~2.5 days of running #13

@punkhop

Description

@punkhop

Environment

  • RepoBar version: 0.1.1 (2)
  • macOS: 26.2 (25C56)
  • Architecture: ARM64
  • Repos monitored: 12

Issue

After running for approximately 2.5 days, RepoBar accumulated ~2GB of memory (physical footprint). After a restart, memory usage dropped to ~77MB.

Diagnostics

Memory snapshot before restart:

TOTAL                                 5.0G     1.1G   139.2M     1.8G       0K    2384K    5504K    27748
                                    VIRTUAL   RESIDENT  DIRTY   SWAPPED

MALLOC zones showed fragmentation:

DefaultMallocZone: 307.1M virtual, 93MB resident, 56% fragmented
AttributeGraph: 16MB (SwiftUI state graph)

Process sample showed the app was idle (waiting in mach_msg2_trap), not actively leaking during sampling - suggests gradual accumulation over time.

Disk caches were fine:

  • Cache.db: ~1.1MB
  • RepoDetailCache: 408KB
  • Total cache folder: 66MB

Likely cause

SwiftUI view state accumulation over time. Each GitHub API poll may be retaining response data or view state without proper release.

Workaround

Periodic restart of the app.

Steps to reproduce

  1. Configure RepoBar with ~12 repositories
  2. Let it run for 2-3 days
  3. Observe memory growth via Activity Monitor or top

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions