-
-
Save pythoninthegrass/52a4642fc31a7e110fe1145608b0e3df to your computer and use it in GitHub Desktop.
Cleanup swap space 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
#!/usr/bin/env bash | |
# To see current swap usage | |
sysctl -a | grep swap | |
# Monitor swap usage | |
vm_stat 60 | |
# Use only when when your system is in a very bad shape | |
sudo pkill -HUP -u _windowserver | |
# To monitor, what's creating/updating these swap files | |
sudo fs_usage | grep swapfile | |
# Or for page ins/outs | |
sudo fs_usage | grep PAGE_ | |
# To see what WindowServer process is doing exactly | |
sudo spindump -reveal $(pgrep WindowServer) | |
# or for kernel_task | |
sudo spindump -reveal 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Comment out lines to be skipped. Could refactor into mini functions w/,main, but why tho
¯\_(ツ)_/¯