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 #3 — fix/ccem-agent-memory-leak
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
APMClientusedURLSessionConfiguration.defaultwhich 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 explicit5srequest timeout and10sresource timeout.File:
CCEMAgent/Sources/CCEMAgent/Services/APMClient.swiftLabels
bug, memory-leak, ccem-agent
Fixed in
PR #3 —
fix/ccem-agent-memory-leak