如何仅使用JRE生成堆转储?

编程入门 行业动态 更新时间:2024-10-26 14:30:52
本文介绍了如何仅使用JRE生成堆转储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们在生产环境中安装了JRE,但没有安装JDK。 JRE和OS的版本如下。

We have a JRE installed on our production environment, but not a JDK. The versions of the JRE and OS are below.

[me@mymachine ~]$ java -version java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode) [me@mymachine ~]$ uname -a Linux mymachine.mydomain 3.10.35-43.137.amzn1.x86_64 #1 SMP Wed Apr 2 09:36:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

似乎jmap工具不存在于系统的任何地方,并且没有root访问权限,我无法将其安装在任何系统位置。我该怎么做才能获得堆转储(即生成.hprof文件)?

It doesn’t appear as if the "jmap" tool is present anywhere on the system, and without root access, I’m not in a position to install it in any system location. What can I do to get a heap dump (i.e. produce a .hprof file)?

另外,如果重要的话,我们正在使用JBoss 7.1.3.AS。 / p>

Also, we're using JBoss 7.1.3.AS if that matters.

推荐答案

内置工具,如 jmap , jconsole 和 jvisualvm 仅在JDK中可用。另一种选择是添加VM参数 -XX:+ HeapDumpOnOutOfMemoryError ,它告诉JVM在发生OutOfMemoryError时自动生成堆转储,并且参数 -XX:HeapDumpPath 指定堆转储的路径。

Built-in tools like jmap, jconsole, and jvisualvm are only available in a JDK. Another option is to add the VM argument -XX:+HeapDumpOnOutOfMemoryError which tells the JVM to automatically generate a heap dump when an OutOfMemoryError occurs, and the argument -XX:HeapDumpPath to specify the path for the heap dump.

如果无法升级JRE以使用服务器中的工具JRE 7( www.oracle。 com / technetwork / java / javase / downloads / server-jre7-downloads-1931105.html ),您可能需要考虑第三方分析工具,如 JProfiler 或者列表这里。

If you cannot upgrade your JRE to use tools like the ones in the server JRE 7 (www.oracle/technetwork/java/javase/downloads/server-jre7-downloads-1931105.html), you may have to consider third-party profiling tools like JProfiler or ones list here.

更多推荐

如何仅使用JRE生成堆转储?

本文发布于:2023-10-20 03:35:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1509726.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:JRE   堆转储

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!