开发者

Safety of generating a threaddump on a production system

开发者 https://www.devze.com 2023-01-31 10:25 出处:网络
We have a production Java system which is using a lot more threads than usual. I would like to use kill -3pid to get a threaddump, and if necessary get a binary heap dump using JConsole for offline an

We have a production Java system which is using a lot more threads than usual. I would like to use kill -3 pid to get a threaddump, and if necessary get a binary heap dump using JConsole for offline analysis in Eclipse MAT.

I am running Java 1.5.0_10开发者_StackOverflow中文版 on RHEL4.

How likely is it that either of these will kill the JVM? What about adverse effects on its performance while the dumps are produced?


It won't kill the VM, but generating a heap dump will likely freeze the JVM during the dump process, since it has to dump a consistent snapshot. Once the dump has finished, it'll resume all threads from where they were suspended. So it won't be destructive, but it'll briefly stop processing.


I use below command to get heap dump

jmap -heap pid

For details - http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html

0

精彩评论

暂无评论...
验证码 换一张
取 消