z****e 发帖数: 54598 | 1 我尝试了一下用kill -3 PID > test.txt去获取thread dump
但是貌似不行,只能用jstack PID > test.txt才可以 |
|
w**z 发帖数: 8232 | 2 visualvm 好像可以, 但还是jstack 最方便。 |
|
a**n 发帖数: 313 | 3 cpu没有用完或甚至没有单个cpu100%, 估计要印想要问你,用jstack 或kill3,
jvisual, 或别的profile tool去attach到那个process看有无deadlock之类.
老印估计是customer support person. 这个是经验问题,所以还是有点黑你。
不过jmap heap dump will not stop process, 所以老印自己也不懂。 |
|
c******n 发帖数: 4965 | 4 多谢, 没有deadlock, jstack -l 可以看到
不应该是deadlock, cuz it goes away naturally after a while
不是我自己的code, 是apache cassandra
他们已经在用thread pool, 不过是unlimited, 所以我才问,
1000 个thread 的pool 是不是不可能handle 了。
正常运行, 到600 个thread 都没有问题, 之后可以ramp up 看看limit 到底是多少 |
|
r*****l 发帖数: 2859 | 5 Use jstack dump thread. Then use TDA to analyze. Remember that thread
behavior is dynamic, so take multiple dumps and try to find the corelation. |
|
c*********n 发帖数: 1057 | 6 我觉得楼主问这种问题还是用英文比较好,那中文看到实在是累,要把专有名字转换成
英文才顺一点,或者是我自己退化的太厉害了?
About the issue, Is your system java based? If so you can use jstack or
visualvm to monitor the system status.
You can also use various system monitoring tool to see if the bottleneck
happens in OS layer. In Windows, like PerfMon. In Linux, like ps, iostat.
Another suggestion is do you have a test client that simulate the client
activities? So you can role out the 3rd party influence. |
|
e*****t 发帖数: 1005 | 7 kill -3 should work, but the thread dump does not necessarily go to your
test.txt
If the jvm were started already redirecting to somewhere, the threaddump
shall goes to that console or file or whatever. |
|
|
T*********g 发帖数: 496 | 9 一般会先问你熟悉的JVM。如果是hotspot,可能会问一下JVM的是怎么对内存分代的。然
后会问几个基本的对不同代的GC收集算法,如果想看看你关注不关注最新的JVM进展的话
可能会问问你G1. 接下来会让你说一个你熟悉的GC算法,然后描述一下收集过程。
很多人会接着问JVM调优或者trouble shoot的基本方法,比如jstack,jmap, jhat分别都
怎么用。 |
|
w*******e 发帖数: 91 | 10 Looking for tool/probe API that can
1. store heap usage/GC info in my specified interval (every minute, 5
mintues, etc)
2. draw the graph in later.
- would jrobin/RRD be the best choice?
- can this be done via java OOTB tools like jhat/jmap/jstack/VisualVM/jmon? |
|
w*******e 发帖数: 91 | 11 Looking for tool/probe API that can
1. store heap usage/GC info in my specified interval (every minute, 5
mintues, etc)
2. draw the graph in later.
- would jrobin/RRD be the best choice?
- can this be done via java OOTB tools like jhat/jmap/jstack/VisualVM/jmon? |
|
z****e 发帖数: 54598 | 12 jstack PID > yourFileName
vi yourFileName |
|
x*x 发帖数: 156 | 13 Thanks a lot!
jstack seems to be informative now. |
|
h****r 发帖数: 2056 | 14 block on Fugure.get, 好像容易造成thread leak,尤其是有I/O的情况.
经常是jstack发现thread数目在增加,原因是有一些thread在死等i/o,
加上timeout也不是都能解决死等i/o的问题。
这种情况下,executor service(也即thread pool)没有avaialble
thread可用,只好为新request开新的thread,老的thread就继续死等
(或者是有某种exception没有handle而死了)leak掉了。
you |
|
w**z 发帖数: 8232 | 15 这四种方法我都用过, 从易到难:
visual VM
jconsole has plugin
kill -3
jstack |
|