java 进程占用内存
查看java进程占用的内存
FIRST_FLAG=true
jps | grep -v Jps | while read line; do
if [[ $FIRST_FLAG == "true" ]]; then
echo PID APP VSZ/MB RSS/MB
FIRST_FLAG=FALSE
fi
pid=$(echo $line | awk '{print $1}')
app=$(echo $line| awk '{print $2}')
vsz=$(ps -p $pid -o vsz|grep -v VSZ)
rss=$(ps -p $pid -o rss|grep -v RSS)
echo $pid $app $[vsz/1024] $[rss/1024]
done | column -t