Summary
After long continuous uptime, Hidden Bar's memory footprint in Activity Monitor can grow to 600MB+. Diagnostic tools (footprint & heap) reveal that while active Resident Memory (RSS) remains small (~50MB), the process accumulates ~190k malloc nodes and ~500MB of swapped/compressed dirty pages.
Diagnostic Findings (footprint & heap)
- Total Malloc Nodes: ~193,000 nodes (MALLOC_SMALL count ~159,700)
- Top Allocated Types:
NSMutableDictionary / CFData: 6,000+ instances
__NSMallocBlock__: 3,200+ instances
CAContext._impl (QuartzCore layer contexts): 800+ instances
Corresponding Source Locations
-
StatusBarController.swift (lines 125-144) — setupHoverToExpandIfEnabled
- High-frequency global mouse movement monitoring (
NSEvent.addGlobalMonitorForEvents(matching: .mouseMoved)) accumulates NSMutableDictionary and CFData event wrapper instances over long runtimes.
-
StatusBarController.swift (lines 316-329) — startTimerToAutoHide
- When deferring auto-collapse (e.g., when the mouse is in the menu bar), repeatedly invalidating and re-scheduling single-shot
Timer instances creates new closure blocks, accumulating __NSMallocBlock__ and dispatch continuations.
-
Assets.swift (lines 13-26) & StatusBarController.swift (lines 270, 281)
Assets.expandImage / collapseImage are computed properties evaluating NSImage(named:) dynamically. Re-assigning button.image on expand/collapse actions repeatedly rebinds AppKit button layer contexts, accumulating CAContext._impl instances.
-
StatusBarController.swift (line 342) — getContextMenu
NotificationCenter.default.addObserver is invoked inside menu construction, which may add duplicate observers if the context menu is re-instantiated.
Hope this diagnostic breakdown helps!
Summary
After long continuous uptime, Hidden Bar's memory footprint in Activity Monitor can grow to 600MB+. Diagnostic tools (
footprint&heap) reveal that while active Resident Memory (RSS) remains small (~50MB), the process accumulates ~190k malloc nodes and ~500MB of swapped/compressed dirty pages.Diagnostic Findings (
footprint&heap)NSMutableDictionary/CFData: 6,000+ instances__NSMallocBlock__: 3,200+ instancesCAContext._impl(QuartzCore layer contexts): 800+ instancesCorresponding Source Locations
StatusBarController.swift(lines 125-144) —setupHoverToExpandIfEnabledNSEvent.addGlobalMonitorForEvents(matching: .mouseMoved)) accumulatesNSMutableDictionaryandCFDataevent wrapper instances over long runtimes.StatusBarController.swift(lines 316-329) —startTimerToAutoHideTimerinstances creates new closure blocks, accumulating__NSMallocBlock__and dispatch continuations.Assets.swift(lines 13-26) &StatusBarController.swift(lines 270, 281)Assets.expandImage/collapseImageare computed properties evaluatingNSImage(named:)dynamically. Re-assigningbutton.imageon expand/collapse actions repeatedly rebinds AppKit button layer contexts, accumulatingCAContext._implinstances.StatusBarController.swift(line 342) —getContextMenuNotificationCenter.default.addObserveris invoked inside menu construction, which may add duplicate observers if the context menu is re-instantiated.Hope this diagnostic breakdown helps!