Skip to content

Instantly share code, notes, and snippets.

@dklanac
dklanac / gist:9f264ac869aeb53a22336ecbb1126300
Created March 20, 2025 14:10
Tally all Chrome memory usage on macOS
chrome_mem=$(ps aux | grep -i "chrome" | grep -v "grep" | awk '{sum += $6} END {print sum/1024}'); total_mem=$(sysctl hw.memsize | awk '{print $2/1024/1024}'); percentage=$(echo "scale=2; ($chrome_mem / $total_mem) * 100" | bc); echo "Chrome Memory: $chrome_mem MB, Percentage of Total: $percentage%"