Created
March 20, 2025 14:10
-
-
Save dklanac/9f264ac869aeb53a22336ecbb1126300 to your computer and use it in GitHub Desktop.
Tally all Chrome memory usage on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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