fix(gui): report macOS phys_footprint in status-bar memory (#3197)#3207
Conversation
|
@AetherClaude does the Activity Monitor tooltip show on Windows and Linux? |
3c9c7ed to
bbbff22
Compare
|
Good catch — yes, it does. The Easiest fix is per-platform tooltip text alongside the per-platform sampling code that's already in this PR: #if defined(Q_OS_WIN)
m_memLabel->setToolTip("AetherSDR process working set (matches Task Manager)");
#elif defined(Q_OS_MAC)
m_memLabel->setToolTip("AetherSDR process physical footprint (matches Activity Monitor)");
#else
m_memLabel->setToolTip("AetherSDR process resident set (VmRSS from /proc/self/status)");
#endifEach variant names the metric and the tool a user can cross-check it against on their own OS, which is the whole point of the change in #3197 — having a number that agrees with what the platform's own task viewer shows. The Linux line names the file rather than a specific tool because users there vary widely (System Monitor / htop / btop / etc.) and they all ultimately read VmRSS anyway. A maintainer can authorize the orchestrator to land this fix by adding the 73, Jeremy KK7GWY & Claude (AI dev partner) 🤖 aethersdr-agent · cost: $1.1837 · model: claude-opus-4-7 |
bbbff22 to
be02689
Compare
…#3197) ru_maxrss is a monotonic high-water mark and on macOS excludes compressed/IOKit/purgeable pages, so the status-bar Mem readout underreported Activity Monitor's Memory column by ~3.8x on an idle session (~859 MB vs ~3.19 GB). Source the macOS metric from task_info(TASK_VM_INFO).phys_footprint - the same value Activity Monitor displays. While here, switch the Linux arm to /proc/self/status VmRSS so all three platforms report "what the OS sees right now" instead of a process-lifetime peak. Windows already used WorkingSetSize, so no change there. Fixes aethersdr#3197
be02689 to
70cd355
Compare
|
Fair point — fixed in #if defined(Q_OS_WIN)
m_memLabel->setToolTip("AetherSDR process working set (matches Task Manager)");
#elif defined(Q_OS_MAC)
m_memLabel->setToolTip("AetherSDR process physical footprint (matches Activity Monitor)");
#else
m_memLabel->setToolTip("AetherSDR process resident set (VmRSS from /proc/self/status)");
#endifEach variant names the metric and the tool a user on that platform can cross-check it against. The Linux line names the kernel-side source file rather than a userspace tool, since users there vary widely (System Monitor / htop / btop / etc.) and they all read Local rebuild on Apple Silicon is clean (no new warnings beyond the pre-existing |
|
Confirmed —
One tiny nit, not blocking: when LGTM from the AetherClaude side — the original #3197 root cause is addressed, the tooltip honesty issue raised by @jensenpat is addressed, and the build is clean on Apple Silicon per the PR description. Linux/Windows CI runs will confirm the other two arms. 73, Jeremy KK7GWY & Claude (AI dev partner) 🤖 aethersdr-agent · cost: $1.7935 · model: claude-opus-4-7 |
Summary
Fixes #3197 — on macOS the status-bar
Memreadout showed ~859 MB while Activity Monitor reported the same process at ~3.19 GB (a ~3.8× understatement).Two distinct problems with the previous
ru_maxrss-based metric on macOS:ru_maxrssmonotonically increases over the process lifetime and never reflects pages that were faulted out or compressed.phys_footprintfromtask_info(TASK_VM_INFO), which sums anonymous + compressed + IOKit + purgeable. For a Qt/QRhi app with Metal driver state and a long-lived spectrum/waterfall pipeline, the delta is large.Changes (single file:
src/gui/MainWindow.cpp)ru_maxrsswithtask_info(mach_task_self(), TASK_VM_INFO, …).phys_footprint— the exact field Activity Monitor renders, so the two readouts agree by construction.ru_maxrssto readingVmRSS:from/proc/self/statusso Linux also reports current resident, not the per-process peak.WorkingSetSizeis already current, not peak.<mach/mach.h>,<mach/task.h>,<mach/task_info.h>) underQ_OS_MAC.All three platforms now report a "what the OS sees right now" footprint, matching the unification the reporter asked for under "unifying behind a
phys_footprint-style metric on all three platforms."Out of scope
Whether ~3 GB on an idle single-slice session is itself excessive (waterfall tile retention, FFT history, Metal/QRhi overhead, leaked textures, etc.). That's a separate investigation, well-suited to the per-thread memory trending in the forthcoming System Info diagnostics dialog (#2554). This PR just unblocks the display so any future investigation has a number that matches Activity Monitor.
Test plan
cmake --build build --target AetherSDR) — compiles clean; only pre-existing-Wdeprecated-this-capturewarnings unrelated to this change.Memvalue should now track Activity Monitor's Memory column within rounding instead of underreporting by ~3.8×./proc/self/statusVmRSS path) — not exercised locally; logic is straightforward but a Linux reviewer / CI run is welcome.Notes for reviewer
src/gui/MainWindow.{h,cpp}— maintainer-only tier per.github/CODEOWNERS, routing this to @ten9876.