Skip to content

Instantly share code, notes, and snippets.

@dklanac
Created March 20, 2025 14:10
Show Gist options
  • Save dklanac/9f264ac869aeb53a22336ecbb1126300 to your computer and use it in GitHub Desktop.
Save dklanac/9f264ac869aeb53a22336ecbb1126300 to your computer and use it in GitHub Desktop.
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%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment