java.lang.Objectcom.jprofiler.agent.Controller
public class Controller
This is JProfiler's profiling API. It is contained in bin/agent.jar in your JProfiler installation directory. Call these static methods from your source code to influence the run time behaviour of JProfiler.
When executing your application without JProfiler, all calls into this class will quietly do nothing.
| Method Summary | |
|---|---|
static void |
saveSnapshot(java.io.File file)
Save a snapshot of all profiling data to disk. |
static void |
startAllocRecording(boolean reset)
Start recording of memory allocations. |
static void |
startCPURecording(boolean reset)
Start recording CPU data. |
static void |
stopAllocRecording()
Stop recording of memory allocations. |
static void |
stopCPURecording()
Stop CPU recording. |
static void |
triggerHeapDump()
Trigger a heap dump. |
static void |
triggerHeapDump(boolean fullGc)
Trigger a heap dump. |
static void |
triggerHeapDump(boolean fullGc,
boolean onlyRecorded)
Trigger a heap dump. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void startCPURecording(boolean reset)
reset - if true, any previously accumulated CPU profiling
data will be discarded. If false, CPU data will be accumulated
accross pairs of invocations of startCPURecording() and
stopCPURecording().public static void stopCPURecording()
public static void startAllocRecording(boolean reset)
reset - if true, any previously recorded profiling
data will be discarded. If false, allocations within all
pairs of invocations of startAllocRecording() and
stopAllocRecording() will be recorded.public static void stopAllocRecording()
public static void triggerHeapDump()
public static void triggerHeapDump(boolean fullGc)
fullGc - if true, a full garbage collection will be performed.
public static void triggerHeapDump(boolean fullGc,
boolean onlyRecorded)
ATTENTION: Taking a heap dump takes a long time (on the order of seconds). If you call this method to often, your application might become unusable or take an excessively long time to finish.
fullGc - if true, a full garbage collection will be performed.onlyRecorded - if true, only objects recorded between startAllocRecording and
stopAllocRecording will be inlucded in the dump.public static void saveSnapshot(java.io.File file)
ATTENTION: Saving a snapshot takes a long time (on the order of seconds). If you call this method to often, your application might become unusable or take an excessively long time to finish, and your hard disk might run out of space.
file - the file to which the snapshot should be saved.