profile-memory

Featured

Profile memory usage in sidecar using Go pprof, system tools, and heap analysis. Covers identifying memory leaks, goroutine leaks, file descriptor accumulation, and CPU profiling. Use when investigating memory issues, profiling performance, debugging memory leaks, or diagnosing unresponsive plugins.

Data & Documents 1,069 stars 81 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 96/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Memory Profiling for Sidecar ## Quick Triage | Symptom | Tool | Action | |---------|------|--------| | High RSS / memory growth | vmmap, pprof heap | Check system memory, then heap profile | | Too many open files | lsof | Check FD count and breakdown | | High CPU | pprof cpu, ps | Capture CPU profile | | Goroutine leak | pprof goroutines | Check goroutine count and stacks | | Plugin unresponsive | lsof + goroutines | Check SQLite locks, blocked goroutines | ``` Triage flow: Is RSS high? -> Check FD count -> Check vmmap -> Check heap profile ``` ## System-Level Profiling (No pprof Required) ### Find the Process ```bash pgrep -f sidecar ps aux | grep sidecar ``` ### Basic Stats ```bash # RSS, VSZ, CPU%, thread count ps -o pid,rss,vsz,%cpu,nlwp -p <PID> # Human-readable RSS ps -o pid,rss -p <PID> | awk 'NR>1{printf "%d MB\n", $2/1024}' # Watch over time while true; do ps -o rss,%cpu -p <PID> | tail -1; sleep 5; done ``` ### System Memory **macOS (vmmap):** ```bash vmmap --summary <PID> ``` Key sections: VM_ALLOCATE (Go heap), MALLOC (C heap/SQLite), Physical footprint, Swapped. Red flags: - RESIDENT SIZE >500MB for idle sidecar - REGION COUNT in thousands for VM_ALLOCATE = mmap leak - SWAPPED SIZE growing = memory pressure **Linux:** ```bash cat /proc/<PID>/status | grep -E 'VmRSS|VmSize|Threads' pmap -x <PID> | tail -5 ls /proc/<PID>/fd | wc -l ``` ### File Descriptor Analysis ```bash # Count and breakdown lsof -p <PID> | wc -l lsof -p <PID> | awk '{print $5}'...

Details

Author
marcus
Repository
marcus/sidecar
Created
8 months ago
Last Updated
2 days ago
Language
Go
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

profiling

性能分析:time 三值、资源监控(htop/btop/iotop/free/lsof/ss)、tidy 数据与绘图、 CPU profiler(perf/火焰图/callgrind)、内存 profiler(massif)、hyperfine 基准。Use when the user asks to profile performance, find bottlenecks, benchmark tools, or investigate resource usage. 触发于「帮我分析性能/找瓶颈/benchmark/查内存占用」。

1 Updated 1 weeks ago
AntheaLaffy
Data & Documents Listed

rust-performance

Profile and optimize Rust code and native libraries. Covers host flamegraphs with cargo-flamegraph and perf, Android on-device profiling with simpleperf, Perfetto, HWASan and ndk-stack symbolication, iOS profiling with Instruments, os_signpost and MetricKit, binary size analysis with cargo-bloat, monomorphization bloat with cargo-llvm-lines, Criterion microbenchmarks and baselines, heap profiling with heaptrack and DHAT, data-parallel work with rayon, and build-time tuning with cargo --timings, sccache, LTO, codegen-units and linker choice. Use when a workload is slow, a binary or app bundle grew, a benchmark regressed, a flamegraph needs reading, a native crash needs symbolication, or a cross-compilation build is slow. Triggers on "flamegraph", "simpleperf", "Perfetto", "Instruments", "cargo-bloat", "binary size", "build time", "LTO", "monomorphization", or any performance question.

2 Updated 1 weeks ago
po4yka
AI & Automation Listed

status

Memory health dashboard showing line counts, topic files, capacity, stale entries, and recommendations.

6 Updated today
kopp0510