Question
How do you collect a TBSM Server JVM Heap Dump?
Answer
Options for getting Java Heap Dump
1) Request Java to Dump Heap on an Out Of Memory error
Add the following to the JVM settings:
-XX:+HeapDumpOnOutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError
This option available in 1.5.0_07 and 1.4.2_12, producing an hprof binary format heap dump
hprof heap dumps are platform independent and so you don't need to analyze the dump on the same system that produced it
Running with -XX:+HeapDumpOnOutOfMemoryError does not impact performance
- it is simply a flag to indicate that a heap dump should be generated
when the first thread throws OutOfMemoryError.
Optional also:
-XX:HeapDumpPath=
-XX:HeapDumpPath
Specifies path to directory or filename for heap dump. (Introduced in 1.4.2 update 12, 5.0 update 7.)
Path to filename for heap dump, i.e. -XX:HeapDumpPath=/some/directory/filename.hprof
Note: On Windows, the JVM can stay trashing (running garbage collections) before it actually reports an OOM.
2) Force a Heap Dump, on demand (Unix Only)
On Unix, add the following to the JVM settings:
-XX:+HeapDumpOnCtrlBreak
This was available on Unix in beginning with SDK 1.4.2.11 and JDK 1.5.0.05.
Then do:
kill -QUIT <pid>
where is pid is the running java process for the application.
In 4.1.1, the command dumps the data into a text file in $NCHOME. You may do a : find . -name javacore* inside $NCHOME.
If using TBSM 4.2 or 4.2.1 the heap dump should be created in the hope directory of the profile i.e.
$TIP_HOME/profiles/TBSMProfile or $TIP_HOME/profiles/TIPProfile
Note: kill -QUIT is equivilant to kill -3 and kill -SIGQUIT
Note: For Windows -XX:+HeapDumpOnCtrlBreak was only introduces in
1.5.0_14. This is above the release of Java in TBSM 4.2.1 (1.5.0 SR 11)
so this option is not possible in current TBSM versions on Windows.
3) Using eWAS (TBSM 4.2 and 4.2.1)
You can get a full JVM heap dump uses eWAS.
Note, that this is only works in Linux , Windows, and AIX.
$TIP_HOME/bin/wsadmin -username tipadmin -password <tipadmin password>
the script will take you to the was admin prompt:
For Impact:
<wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,node=ImpactNode,*]
For Data Server
<wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,node=TBSMNode,*]
For Dashboard Server
<wsadmin>set objectName [$AdminControl queryNames WebSphere:type=JVM,process=server1,node=TIPNode,*]
This command will set up the variable objectName, then in the prompt invoke it:
<wsadmin> $AdminControl invoke $objectName generateHeapDump
The command will dump the heap as .phd file in
$TIP_HOME/profiles/TBSMProfile or $TIP_HOME/profiles/TIPProfile. It
should give you the full path and name of the file.
NOTE: that in Linux if the application goes out of memory, it dump the
above 2 steps by default. In Solaris, you have to specify it in a
script.
4) JConsole
You could utilize JConsole by calling the HotSpotDiagnostic MBean and
the dumpHeap operation if it's available from your Sun JVM.
Note: Jconsole is not shipped with the JRE in TBSM. You will need to
install the 1.6 Java JDK for JConsole. 1.6 JDK can be installed on a
client machine and can connect remotely to the TBSM JVM if the following
startup JVM options are set for TBSM.
JConsole from 1.6 JDK can connect to earlier version of JVM, i.e. looks
like you can use a 1.5 Sun JDK's JConsole to connect to a Sun 1.4.2 JVM:
http://forums.oracle.com/forums/thread.jspa?threadID=1175181&tstart=180
.
You can run JConsole on JDK 5.0 and still connect to an application running
on JDK 1.4.2. You will get access to your application MBeans through the MBeans tab but
you won't get access to the M&M tabs and platform MBeans as they didn't
exist in JDK 1.4.2.
If you need to access M&M tabs (threads, memory usage etc...),
your application have to run on JDK 5.0, started with
-Dcom.sun.management.jmxremote java option.
Set the following options:
-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
See link for more information
To open jconsole (just type jconsole), and go to the mbeans tab. In the
left hand tree structure look for the following folder;
com.sun.management.
Expand and click on HotSpotDiagnostic. In the right hand window click on
operations. There should be an option to dump the heap memory.
5) Jmap (only for version 1.6 on Windows)
jmap prints shared object memory maps or heap memory details of a given process or core file or a remote debug server.
This is not available on the JRE shipped with TBSM. For this (like JConsole) the JDK is required.
It is available on version 1.5 for Linux and 1.6 for Windows JDK.
Usage:
jmap -histo <pid>
(to print histogram of java object heap of the JVM process)
jmap -dump:<dump-options> <pid>
(to dump java heap of the JVM process)
dump-options:
format=b binary default
file=<file> dump heap to <file>
Example: jmap -dump:format=b,file=heap.bin <pid>
jmap -dump:live,file=heap.dump.out,format=b <pid>
Note: On windows you must have -Xrunhprof:heap=dump,format=b,file=C:\java.hprof,doe=y
NOTE: Xrunhprof caused TBSM to run slowly.
分享到:
相关推荐
IBM最新java heapdump分析工具 java -jar ha.jar -Xmx4096m ha.jar
java heapdump_tool 内容查询工具
heapdump工具可以帮助开发者诊断Java应用的内存泄漏、过度对象创建等问题,从而优化系统性能。 首先,heapdump是一个包含Java虚拟机(JVM)堆内存快照的文件,它记录了程序运行时所有对象以及它们之间的引用关系。...
Heapdump-tool工具是专为Java开发者设计的,用于生成和分析堆转储(Heap Dump)文件的强大工具。堆转储文件记录了Java虚拟机(JVM)在某一时刻的内存状态,包括对象、类、垃圾收集器信息等,这对于诊断内存泄漏、...
Heap dump文件是Java虚拟机(JVM)在特定时间点生成的一种文件,它包含了JVM堆内存中的所有对象及其引用关系、类信息、垃圾收集信息等。当程序运行时遇到内存问题,如频繁的垃圾回收或内存溢出,生成heap dump可以...
JavaCore和HeapDump是两种重要的Java应用程序诊断工具,它们用于理解和优化Java应用程序的性能和内存使用情况。在Java运行环境中,遇到性能问题或者内存泄漏时,开发者通常会借助这类工具来定位问题。 JavaCore,也...
`javacore`和`heapdump`文件就是用来记录和诊断这类问题的重要工具。本篇文章将详细讲解如何使用`javacore`和`heapdump`分析工具,特别是针对Websphere环境的`ha`和`jca`工具,以及如何使用JDK1.6来打开和解析这些...
2. 运行heapdump.bat脚本,这个脚本通常会调用Java命令行来运行ha456.jar,例如:`java -jar ha456.jar heapdump.hprof` 3. 工具会输出内存分配的概览,包括类、对象的数量、大小等信息。 4. 通过这些信息,可以识别...
javacore 文件及 heapdump 文件分析 javacore 文件和 heapdump 文件是 Java 应用程序在遇到致命问题时产生的两个文件,这两个文件可以帮助我们分析和解决 Java 应用程序中的问题。 javacore 文件是一个文本文件,...
heapdump分析工具------HeapAnalyzer: 2014年1月最新发布 用法: 在命令行执行 java -Xmx500m -jar ha453.jar
在IT领域,尤其是在企业级应用服务器的运维与故障排查中,收集Heapdump和JavaCore是诊断Java应用程序内存泄漏、性能瓶颈以及异常行为的关键步骤。本文将深入解析在AIX系统环境下,如何通过设置特定环境变量来有效...
Java Thread Dump Analyzing
在IT领域,尤其是在Java应用程序的性能调优过程中,生成javacore和heapdump文件是非常重要的步骤。这些文件能帮助我们诊断应用程序的内存泄漏、性能瓶颈等问题。本篇将详细讲解如何利用wsadmin工具来生成这两种文件...
heapdump分析工作heapanalyzer的使用及工具 java -Xmx1000m -jar ha443.jar
"ha25.zip-分析heapdump日志"是一个专门针对Java内存溢出问题进行分析的压缩包文件,它包含了一些工具和文档,帮助开发者诊断和解决内存问题。 首先,heapdump是一个Java虚拟机(JVM)生成的文件,它记录了在特定...
1. **生成堆转储文件**:通过`-dump:format=b,file=<filename>`选项,我们可以将Java进程的堆内存信息导出为一个二进制格式的文件,通常命名为`heapdump.hprof`。这个文件包含了JVM堆中的所有对象及其引用关系,是...
IBM堆转储(heapdump)分析工具是一种专门用于解析和诊断IBM Java虚拟机(JVM)内存状况的工具。在Java应用程序运行过程中,如果遇到内存溢出或性能问题,IBM JVM会产生heapdump文件,其中包含了应用程序运行时内存...
IBM HeapDump分析工具 java应用在内存泄露时会生成heapdump文件,分析heapdump文件,成为定位哪些对象占用了太多的堆栈空间的重要手段
javacore.txt文件用jca打开,heapdump.phd文件用ha打开。 Heap dump 文件是一个二进制文件,它保存了某一时刻在 Java 堆中所有对象的状态。这个文件最重要的作用就是分析 Java 堆内存泄露问题,heap analyzer,MAT ...
Heapdump是Java虚拟机(JVM)在运行时创建的一种内存快照,包含了在特定时间点所有对象及其占用内存的情况。IBM WebSphere Heapdump Analyzer通过解析这些heapdump文件,提供深入的内存分析报告。 这个工具的核心...