来自:http://publib.boulder.ibm.com/infocenter/javasdk/v1r4m2/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.142j9%2Fhtml%2Fenabling_a_heapdump.html
You can generate a Heapdump from a running JVM in either of two ways:
- Explicit generation
- JVM-triggered generation
When the Java™ heap is exhausted (that is, the OutOfMemory
condition is encountered and the resulting exception is not caught or handled
by the application), JVM-triggered generation is enabled by default, as are
Heapdumps that are generated by other programming methods.
To enable
signal-based Heapdumps, set the IBM_HEAPDUMP
or IBM_HEAP_DUMP
environment variable to any value,
export IBM_HEAPDUMP=<any_value>
export IBM_HEAP_DUMP=<any_value>
or set the appropriate JAVA_DUMP_OPTS
before you start the Java process. You can also use the -Xdump agent
option to get more fine-grained control over
Heapdumps. See Using dump agents
for more information.
To display on JVM startup the conditions (if any) that will generate a
Heapdump (or javadump or systemdump), you can use -Xdump:what
. See Using dump agents
for more information.
To disable generation of a Heapdump, on platforms other
than Windows® use:
unset IBM_HEAPDUMP
unset IBM_HEAP_DUMP
On Windows, use:
set IBM_HEAPDUMP=
set IBM_HEAP_DUMP=
You can explicitly generate
a Heapdump in the following
ways:
- By sending a signal to the JVM from the operating system
- By using the HeapDump()
method inside Java code
that is being executed
- By using the JVMRI to request a Heapdump from a loaded agent
You can explicitly request
a Heapdump in the same
way as a Javadump. Before the Heapdump starts, the heap is locked and remains
locked until the whole Heapdump file is written to disk. This operation can
affect the behavior of your Java application, and make it unresponsive
while the dump is being produced.
For Linux and AIX®, send the JVM the signal SIGQUIT
(kill -QUIT
, or Ctrl+\ in the console window).
For Windows, generate a SIGINT (press the Ctrl+Break keys
simultaneously).
You can explicitly request a Heapdump from a Java method. The class com.ibm.jvm.Dump
contains a static HeapDump()
method that
causes Java code to initiate a Heapdump. To
use the methods in the com.ibm.jvm.Dump
class, you must
have the underlying VM Reliability, Availability, and Serviceability Interface
(JVMRI) enabled, by setting -Xtrace
on the Java command
line. For more information about JVMRI, see Using the Reliability, Availability, and Serviceability
Interface
.
The following events automatically trigger the JVM to produce a Heapdump
(if enabled):
- An OutOfMemory or heap exhaustion condition occurs and
the resulting exception is not caught or handled by the application
- If Heapdumps are enabled, they are normally produced immediately
before a Javadump.
The first option is enabled by default, and you can see it with -Xdump:what
. It gives a snapshot of the Java heap
when no more memory is available. Usually, this snapshot is the most useful
output to help you determine the cause of an OutOfMemory condition that is
related to the Java heap. It works independently of the IBM_HEAPDUMP
environment variable. So, by default, you get Heapdumps
only when no more heap space is available; you do not get Heapdumps in crashes
or through a signal to the JVM. You can disable this feature, and a similar
one for Javadumps, by using IBM_HEAPDUMP_OUTOFMEMORY=FALSE
and IBM_JAVADUMP_OUTOFMEMORY=FALSE
respectively.
Sometimes an application will catch and handle an OutOfMemory
condition, in which case no heapdumps will be taken. You can force heapdump
generation for any handled OutOfMemory conditions, by setting IBM_HEAPDUMP_OUTOFMEMORY=TRUE
and IBM_JAVADUMP_OUTOFMEMORY=TRUE
respectively.
The generated Heapdump is by default in the binary, platform-independent,
phd format, which can be examined using the available tooling (see Available tools for processing Heapdumps
).
However, it is sometimes useful to have an immediately readable view of the
heap. You can obtain this view by using the opts=
stanza
with -Xdump:heap
(see Using dump agents
)
or by the existence of an environment variable:
-
IBM_JAVA_HEAPDUMP_TEST
, which allows you to perform
the equivalent of opts=PHD+CLASSIC
-
IBM_JAVA_HEAPDUMP_TEXT
, which allows the equivalent
of opts=CLASSIC
分享到:
相关推荐
IBM出的一款堆内存对象分析ha(heap analyser)工具,可以用来分析websphere生成的内存转储phd格式文件。 使用方法 1.下载ha457.jar 2.java -Xmx4g -jar ha456.jar 3.打开heapdump.phd 4.他就会显示下面的图片,出现...
使用 Memory Analyzer 来分析生产环境的 Java 堆转储文件,可以从数以百万计的对象中快速计算出对 象的 Retained Size,查看是谁在阻止垃圾回收,并自动生成一个 Leak Suspect(内存泄露可疑点) 报表。 Memory ...
IBM出的一款堆内存对象分析ha(heap analyser)工具,可以用来分析websphere生成的内存转储phd格式文件。使用方法:java -jar -Xmx1000m ha457.jar
利用Windows内存转储文件对挥发性数据取证,张中文,曹天杰,本文给出了如何对挥发性内存数据进行取证获取有用信息,描述了崩溃转储的配置步骤和转储文件的分析过程。使用Microsoft Debugging Tools��
Windows的代理DLL,用于在JNI级别上转储JVM类。JVM Dump Proxy Windows的代理DLL,用于在JNI级别上转储JVM类。 简介一些Java程序使用反射通过动态加载和执行类来隐藏其代码。 您可以从内存中转储它们,但是如果它们...
监视JVM线程并在给定时间内阻塞线程时保存线程转储。 用法 从下载jar 将其添加到要监视的应用程序的命令行中: java -javaagent:jvm-monitoring-agent-0.9.0.jar=threshold=1000,debug ...rest of command 配置...
使用 Eclipse Memory Analyzer 进行堆转储文件分析_files
vc++ 6.0使用dbghelp.dll生成dmp内存转储文件,包含h、lib和dbghelp.dll文件,仅供参考。
IBM出的一款内存分析工具,可以用来分析websphere生成的内存转储phd格式文件 使用方法: java -jar -Xmx3000m ha456.jar heapdump.20141113.171336.1693.0009.phd 一般这种文件都很大,最好使用64位系统,不然会跑不...
MemoryAnalyzer-jvm内存分析工具,可以将转储的dump文件解析成图形化,能够清晰的看到项目的内存占用情况以及gc回收详情
这个工具可以dump内存,将目前计算机的内存镜像保存为raw文件,然后方便使用kali中的取证工具进行取证分析。
UB转储订单的配置和操作。介绍工厂间UB转储,带交货单的UB转储订单操作。对应配置过程,测试过程等,内容比较全
用法 android_dump_memory <dump> <pid> <start> <total> [search string]dump:将内存内容转储到文件中。 文件名将采用./dump_startaddress_endaddress格式。 show:在控制台中打印内存内容。 search:搜索ASCII / ...
一个基于JHat(与JDK打包在一起)的独立堆分析工具,使用Scala和现代库进行了重写。 为什么? 作为专业开发人员,JHat拯救了我的命,JHat偶尔拯救了我的生命(尤其是凌晨3点)。 但是自从JHat首次构建以来,它就...
windows 应用程序崩溃时的内存转储及dump文件的分析
4. jhat:虚拟机堆转储快照分析工具 3 5. jmap:内存映像工具 3 6. jstack:java堆栈跟踪工具 3 7. VisualVM:多合一故障处理工具 3 8. jconsole: 略 3 9. Memory Analyzer Tool(MAT)Eclipse插件 3 二、 JVM参数 ...
反调试和内存转储Android的反调试和反内存转储此项目中使用了一些已知的反调试和反内存转储技术。 重点是在不依赖Java API的情况下以隐身方式使用这些技术。 以下是使用的技术Java的反调试JDWP在/ proc / self / ...
Lua内存快照转储实用程序,用于内存泄漏检测。 关于 关于此代码: : 。 (中国人) 只需运行“ Example.lua”即可快速入门。 与Lua 5.1、5.2和5.3兼容。 支持将按引用计数排序的所有lua对象引用信息转储到本地...
对于大型 JAVA 应用程序来说,再精细的测试也难以堵住所有的漏洞,即便我们在...JVM 能够记录下问题发生时系统的部分运行状态,并将其存储在堆转储 (Heap Dump) 文件中,从而为我们分析和诊断问题提供了重要的依据。
oracle 数据库转储文件对于大家研究oracle数据库有很大帮助,但是如何转储是很多人遇到的问题,希望此教程能够给大家提供帮助。