#!/bin/bash
function kill_mem_over_15
{
info=`ps -auxf | awk 'NR>1{print $0}' | sort -nr -k6 | head -10 | awk '{if($4>15){print $0}}'`
echo "$info"
echo "Hi Blues"
#echo $info | awk '{print $2}' | xargs sudo kill -9
if [[ $info ]]; then
echo $info >> info.log
echo $info | awk '{print $2}' | xargs sudo kill -9
fi
}
while true
do
kill_mem_over_15
sleep 100s
done