fix: use phys_footprint on macOS to match Activity Monitor

Switch from MACH_TASK_BASIC_INFO (resident_size) to TASK_VM_INFO
(phys_footprint) which matches Activity Monitor's Memory column.
Also: capacity-aware heap estimation, entry counts in memory payload,
heap_bytes tests for all stores.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-03-30 12:06:23 +03:00
parent e6489d4a1f
commit a5a3a0552d
10 changed files with 178 additions and 47 deletions

View File

@@ -817,13 +817,12 @@ function renderMemory(mem, stats) {
document.getElementById('memoryRss').textContent = formatBytes(mem.process_rss_bytes);
document.getElementById('memorySub').textContent = 'est. ' + formatBytes(mem.total_estimated_bytes);
// Entry counts from sibling stats objects (avoid duplication in memory payload)
const entryCounts = {
cache: stats.cache.entries,
blocklist: stats.blocking.domains_loaded,
cache: mem.cache_entries,
blocklist: mem.blocklist_entries,
query_log: mem.query_log_entries,
srtt: mem.srtt_entries,
overrides: stats.overrides.active,
overrides: mem.overrides_entries,
};
// Sidebar panel
@@ -852,7 +851,7 @@ function renderMemory(mem, stats) {
<div class="memory-bar">${barSegments}</div>
${rows}
<div class="memory-rss">
<span>Process RSS</span>
<span>Process Footprint</span>
<span>${formatBytes(mem.process_rss_bytes)}</span>
</div>
`;