Created
January 20, 2023 12:37
-
-
Save Salamandar/d31a639de17ae9beab8b43cf6f48efe2 to your computer and use it in GitHub Desktop.
Record ram usage
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
#!/bin/bash | |
ram_usage() { | |
free -m | grep Mem | awk '{print $3}' | |
} | |
base=$(ram_usage) | |
max=0 | |
while true; do | |
usage=$(ram_usage) | |
diff=$((usage - base)) | |
if (( usage > max )); then | |
max=$usage | |
echo "usage: $usage MB, diff = $diff MB" | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment