定位脚本

查线程状态

sudo -u admin /opt/taobao/java/bin/jstack  1601 | grep -A 5 -B 5 'HSFBizProcessor'| grep 'java.lang.Thread.State' | awk -F 'java.lang.Thread.State:' '{print $2}' | sort | uniq -c 

java thread 的状态:

  • NEW (创建未开始)
  • RUNNABLE
  • BLOCKED
    进入monitor区(synchronized)
  • WAITING
    Object.wait
    Thread.join
    LockSupport.park
  • TIMED_WAITING
    Thread.sleep
    Object.wait with timeout
    Thread.join with timeout
    LockSupport.parkNanos
    LockSupport.parkUntil
  • TERMINATED

你可能感兴趣的:(定位脚本)