Created
September 7, 2011 20:51
-
-
Save arturaz/1201690 to your computer and use it in GitHub Desktop.
Skype guardian - kill memhungry skype processes
This file contains 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 | |
while true; do | |
mem_used=$(ps aux | grep -P "\bskype\b" | grep -v grep | awk {'print $5'}) | |
mem_limit=$((1024 * 512)) # 512mb | |
if (("$mem_used" >= "$mem_limit")); then | |
killall -9 skype | |
notify-send -i error "Skype was killed because it reached $mem_limit KB limit" | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment