|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jorphan.util.HeapDumper
public class HeapDumper
Class allowing access to Sun's heapDump method (Java 1.6+). Uses Reflection so that the code compiles on Java 1.5. The code will only work on Sun Java 1.6+.
Method Summary | |
---|---|
static String |
dumpHeap()
Dumps live objects from the heap to the outputFile file in the same format as the hprof heap dump. |
static String |
dumpHeap(boolean live)
Dumps objects from the heap to the outputFile file in the same format as the hprof heap dump. |
static String |
dumpHeap(File basedir,
boolean live)
Dumps objects from the heap to the outputFile file in the same format as the hprof heap dump. |
static void |
dumpHeap(String fileName)
Dumps live objects from the heap to the outputFile file in the same format as the hprof heap dump. |
static void |
dumpHeap(String fileName,
boolean live)
Dumps the heap to the outputFile file in the same format as the hprof heap dump. |
static void |
init()
Initialise the dumper, and report if there is a problem. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void init() throws Exception
Exception
- if there is a problem finding the heapDump MXBeanpublic static void dumpHeap(String fileName, boolean live) throws Exception
Calls the dumpHeap() method of the HotSpotDiagnostic MXBean, if available.
fileName
- name of the heap dump file. Must be creatable, i.e. must not exist.live
- if true, dump only the live objects
Exception
- if the MXBean cannot be found, or if there is a problem during invocationpublic static void dumpHeap(String fileName) throws Exception
fileName
- name of the heap dump file. Must be creatable, i.e. must not exist.
Exception
- if the MXBean cannot be found, or if there is a problem during invocationdumpHeap(String, boolean)
public static String dumpHeap() throws Exception
Creates the dump using the file name: dump_yyyyMMdd_hhmmss_SSS.hprof The dump is created in the current directory.
IOException
Exception
- if the MXBean cannot be found, or if there is a problem during invocationdumpHeap(boolean)
public static String dumpHeap(boolean live) throws Exception
Creates the dump using the file name: dump_yyyyMMdd_hhmmss_SSS.hprof The dump is created in the current directory.
live
- true id only live objects are to be dumped.
IOException
Exception
- if the MXBean cannot be found, or if there is a problem during invocationdumpHeap(String, boolean)
public static String dumpHeap(File basedir, boolean live) throws Exception
Creates the dump using the file name: dump_yyyyMMdd_hhmmss_SSS.hprof
basedir
- File object for the target base directory.live
- true id only live objects are to be dumped.
IOException
Exception
- if the MXBean cannot be found, or if there is a problem during invocationdumpHeap(String, boolean)
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |