PID Memory Inspector is a powerful visualization and diagnostics tool for tracking memory usage per process over time — with full support for process trees and snapshots.
- 📈 Live-like graphs of RAM and Swap usage
- 🌲 Tree-based process snapshots at any point in time
- 🔍 Drill-down into any PID: its own memory + all children
- 📊 Graphs: own RSS, subtree RSS, children trends
- 🧠 Filter by lifetime, RSS thresholds, subtree memory
- 🧭 Per-level tree exploration (level 0 / 1 / 2 / ...)
- 🔗 Clickable PID / PPID navigation
- 📎 Auto-aggregated summaries and stats
- 📁 Works with CSV dumps from
dumps/time/
-
Collect memory usage dumps with:
python scripts/collect_memory.py
This periodically creates:
sys_mem_*.csv— system metrics (/proc/meminfo)process_mem_*.csv— processes (psdump)
-
Run the app:
make run # or uvicorn src.app:create_app --reload --factory -
Open in browser: http://localhost:8000
/api/v1/— Home dashboard: RAM + Swap graphs/api/v1/snapshot/level?lvl=N— Processes at level N/api/v1/snapshot/pid?pid=...— Explore subtree of a given PID/api/v1/snapshot/pid/plot?pid=...— Graphs + stats for PID + children
All views are interactive, filterable, and linked via PID navigation.
scripts/collect_memory.py— CSV memory dumpersrc/application/— orchestration layer (MetricsService)src/domain/— core logic: tree stats, filters, timelinessrc/interfaces/web/— FastAPI routes, HTML + Plotlystatic/mem.css— table styling
- Python 3.11 + FastAPI
- Pandas for data handling
- Plotly for visualizations
- PureCSS for lightweight styling
- Custom layered architecture
lifetime ≥ 300sRSS ≥ 100 MBsubtree_rss ≥ 500 MB
- Per-process
Swap:from/proc/<pid>/smaps_rollup - CGroup-aware memory rollups
- Export to JSON / PNG / CSV
- Alerting on anomalies (spikes, leaks)
Made with ♥ for anyone who's ever had to answer:
"Wait... what process is eating all the RAM?"