如何从运行tomcat 7获取堆转储 [英] ways how to get heap dump from running tomcat 7

查看:187
本文介绍了如何从运行tomcat 7获取堆转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过这个从Tomcat 6获取JVM上的堆转储
但它对我不起作用,是否还有其他方法可以从tomcat服务器获取堆转储?提前致谢!

I've tried this Get a heapdump on JVM from Tomcat 6 but it doesn't work for me, Is there other ways to get heap dump from tomcat server? Thanks in advance!

推荐答案

获取堆转储的最简单方法是使用 jmap 。在带有java进程的机器上执行jmap命令。使用示例:

The easiest way to get heap dump is to use jmap. On the machine with java process execute jmap command. Example of usage:

jmap -dump:file=/mnt/heapdump_2013-04-01.data 29842

使用 jps 知道java Pid。

use jps to know java Pid.

您可以通过 jvisualvm 进行堆转储。您可以通过 jmx jstatd 。你可以在远程机器上进行堆转储和存储。

Also you can make heap dump via jvisualvm. You can connect to the remote machine via jmx or jstatd. You can make heapdump and store on the remote machine.

分析堆转储可以建议你: MAT 。非常强大的工具,可以让您快速了解问题。你可以找到这里好的inro到MAT。

To analyze heapdumps can advice you: MAT. Very powerful tool which allow you to quickly understand problems. You can find here good inro to the MAT.

如果您不想长时间停止申请,您可以制作二进制文件dump(你可以使用gcore或者gdb )。您可以使用jmap分析gdb转储。有关详细信息,请参阅 atlassian blog 。谨防一些 问题

If you don't want to stop application for a long time you can make binary dump(You can use gcore or gdb). And you can use jmap to analyze gdb dump. More information you can read on the atlassian blog. Beware of some issues.

这篇关于如何从运行tomcat 7获取堆转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆