当前位置:首页 > 开发 > 编程语言 > 多线程 > 正文

Linux下Java线程状态分析

发表于: 2014-06-11   作者:cpjsjxy   来源:转载   浏览:
摘要: 在Linux上输入top 进入top后按【shift】+【H】组合键,按线程方式查看线程ID、CPU消耗状况等 通过这种方式获取耗CPU的线程后查看ThreadDump文件做进一步分析 获取ThreadDump的方法: jstack -l pid >jstack.log "Attach Listener" daemon prio=10 tid
在Linux上输入top
进入top后按【shift】+【H】组合键,按线程方式查看线程ID、CPU消耗状况等
通过这种方式获取耗CPU的线程后查看ThreadDump文件做进一步分析
获取ThreadDump的方法:
jstack -l pid >jstack.log




"Attach Listener" daemon prio=10 tid=0x00007fd388001000 nid=0x76e6 waiting on condition [0x0000000000000000]



线程名称: Attach Listener
* 线程类型:daemon
* 优先级:10,默认是5
* jvm线程id:jvm内部线程的唯一标识, 0x00007fd388001000
* 对应系统线程id:和top命令查看的pid对应,不过一个是10进制,一个是16进制。0x76e6
* 线程状态:waiting on condition
* 起始栈地址: [0x0000000000000000]
线程状态详解

Runnable
_The thread is either running or ready to run when it gets its CPU turn.
Wait on condition
_The thread is either sleeping or waiting to be notified by another thread._
Waiting for Monitor Entry and in Object.wait()
_The thread is waiting to get the lock for an object (some other thread may be holding the lock). This happens if two or more threads try to execute synchronized code. Note that the lock is always for an object and not for individual methods._

Linux下Java线程状态分析

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号