linux-查看进程的所有线程
使用top查看某一进程的线程
top -H -p <pid>
top -H -p 4516
top - 21:29:50 up 1:01, 1 user, load average: 1.56, 0.97, 0.75
Threads: 41 total, 0 running, 41 sleeping, 0 stopped, 0 zombie
%Cpu0 : 4.4 us, 0.7 sy, 0.0 ni, 94.3 id, 0.3 wa, 0.0 hi, 0.3 si, 0.0 st
%Cpu1 : 0.3 us, 0.7 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu2 : 3.0 us, 0.7 sy, 0.0 ni, 96.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 0.7 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu4 : 6.0 us, 0.7 sy, 0.0 ni, 93.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu5 : 1.0 us, 0.7 sy, 0.0 ni, 98.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu6 : 4.7 us, 1.0 sy, 0.0 ni, 94.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu7 : 2.7 us, 0.3 sy, 0.0 ni, 97.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 16141140 total, 11485768 free, 3075772 used, 1579600 buff/cache
KiB Swap: 8388604 total, 8388604 free, 0 used. 12726008 avail Mem
进程 USER PR NI VIRT RES SHR %CPU %MEM TIME+ COMMAND
4517 yunweicai -1 5651916 362388 44260 S 2.0 2.2 0:03.94 /usr/bin/java -XX:+IgnoreUnrecognizedVMOptions -Xms64m -Xmx1024m -jar /usr/lib/+
4533 yunweicai -2 5651916 362388 44260 S 0.7 2.2 0:02.17 /usr/bin/java -XX:+IgnoreUnrecognizedVMOptions -Xms64m -Xmx1024m -jar /usr/lib/+
4530 yunweicai 20 5651916 362388 44260 S 0.3 2.2 0:03.38 /usr/bin/java -XX:+IgnoreUnrecognizedVMOptions -Xms64m -Xmx1024m -jar /usr/lib/+
4531 yunweicai 20 5651916 362388 44260 S 0.3 2.2 0:03.68 /usr/bin/java -XX:+IgnoreUnrecognizedVMOptions -Xms64m -Xmx1024m -jar /usr/lib/+
4582 yunweicai 20 5651916 362388 44260 S 0.3 2.2 0:00.03 /usr/bin/java -XX:+IgnoreUnrecognizedVMOptions -Xms64m -Xmx1024m -jar /usr/lib/+
PR为优先级, 负值越负的厉害, 优先级越高,
和SCHED_RR 两种情况 其范围为 1和99, 显示为负值
查看所有所有进程的所有线程
ps -eLf 查看所有所有进程的所有线程