Linux下Java线程状态分析

在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]
线程状态详解

[b]Runnable[/b]
_The thread is either running or ready to run when it gets its CPU turn.
[b]Wait on condition[/b]
_The thread is either sleeping or waiting to be notified by another thread._
[b] Waiting for Monitor Entry and in Object.wait()[/b]
_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._
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值