Skip to content

CCEMAgent memory leak: URLSession cache grows to 2.5GB over multi-day sessions #4

@peguesj

Description

@peguesj

Description

CCEMAgent menubar app accumulated up to 2.5GB physical memory footprint over 4-day sessions, causing 74.9% CPU burn and periodic macOS menubar UI stalls.

Root Cause

APMClient used URLSessionConfiguration.default which caches HTTP responses to disk and memory indefinitely. Over a 4-day session with APM polling every 5–10 seconds, this accumulated ~170,000 cached responses.

Fix

Switch to URLSessionConfiguration.ephemeral (no disk/memory cache). Add explicit 5s request timeout and 10s resource timeout.

File: CCEMAgent/Sources/CCEMAgent/Services/APMClient.swift

Labels

bug, memory-leak, ccem-agent

Fixed in

PR #3fix/ccem-agent-memory-leak

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions