Labels

Thursday, August 8, 2019

how to check open threads , CPU usage & RAM used


ps -o thcount <pid>                         --- total threads opened for pid
ps hHup <pid>                                   -- to list all threads
/software/jdk/jdk1.8.0_161/bin/jcmd <pid> Thread.print   ==== to take instan thread dump
ps -eo "pcpu,pid,args"|grep java|sort -n
ps -o pid,user,%mem,command ax | sort -b -k3 -r                                             --- works good
ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 20                               --- works good
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -20                       --- works
pmap 30537 | tail -n 1
ps aux --sort -rss
==== memory consumed by each user ========
ps axo rss,comm,pid \
| awk '{ proc_list[$2]++; proc_list[$2 "," 1] += $1; } \
END { for (proc in proc_list) { printf("%d\t%s\n", \
proc_list[proc "," 1],proc); }}' | sort -n | tail -n 10 | sort -rn \
| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}'
==========
ps -efwww|grep java

3 comments:

  1. Hi, I really enjoyed reading your post, and hope to read more. Thank you so much for sharing this. when asked what are your salary expectations

    ReplyDelete
  2. I have read few of the articles on your website, and I really like your style of blogging. I added it to my favorites blog list and will be checking back soon. Checkout Youtube Free Music Download

    ReplyDelete