Last active
September 29, 2023 16:16
-
-
Save aitseitz/279c16d614f997497ed6f396a068f7c4 to your computer and use it in GitHub Desktop.
Checks for RAM and SWAP 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 | |
echo "free -m:" | |
free -m | |
echo " " | |
echo "------" | |
echo "sysctl vm.swappiness :" | |
sysctl vm.swappiness | |
echo " " | |
echo "------" | |
echo "cat /proc/meminfo:" | |
cat /proc/meminfo | |
echo " " | |
echo "------" | |
echo "check swap usage sorted by process names:" | |
#cat /proc/18361/status | grep -i "VmSwap" | |
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | cat | |
# Additional Checks with root permissions: | |
#echo " " | |
#echo "------" | |
#echo "sudo cat /proc/slabinfo" | |
#sudo cat /proc/slabinfo | |
#echo " " | |
#echo "------" | |
#echo "sudo slabtop" | |
#sudo slabtop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change Swapiness:
Option 1: --> Temporary:
Option 2: --> Permanently