public final class Snapshot extends Handle implements java.lang.Runnable
NOTE: Do not forget to clean up the snapshot object using the close()
method.
Modifier and Type | Class and Description |
---|---|
static class |
Snapshot.Options
Options class represents options for taking a performance snapshots.
|
protected static class |
Snapshot.SnapshotResource
This class is responsible for destroying a native resource when the instance is collected by GC.
|
INFINITE_TIMEOUT, INVALID_HANDLE_VALUE, STATUS_ABANDONED_WAIT_0, STATUS_TIMEOUT, STATUS_WAIT_0
Constructor and Description |
---|
Snapshot(Snapshot.Options options)
Creates a snapshot of specified processes in the system, as well as heaps, modules, and threads used by these processes.
|
Snapshot(Snapshot.Options options,
long processID)
Creates a snapshot of specified processes in the system, as well as heaps, modules, and threads used by these processes.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the snapshot.
|
java.util.List |
getHeapEntries(long processID,
long heapID) |
java.util.Iterator |
getHeapEntriesIterator(long processID,
long heapID)
Returns a list of heap entries for the given process and the heap.
|
java.util.List |
getHeapList()
Returns a list of heap list from a snapshot.
|
java.util.Iterator |
getHeapListIterator()
Returns iterator for enumerating heap list from a snapshot.
|
java.util.Iterator |
getModuleIterator()
Returns an iterator for enumerating modules from the snapshot.
|
java.util.List |
getModules()
Returns a list of modules from the snapshot.
|
Snapshot.Options |
getOptions()
Returns SnapshotOptions.
|
java.util.List |
getProcesses()
Returns a list of processes from the snapshot.
|
long |
getProcessID()
Returns a specified processID.
|
java.util.Iterator |
getProcessIterator()
Returns an iterator for enumerating processes from the snapshot.
|
java.util.Iterator |
getThreadIterator()
Returns iterator for enumerating threads from a snapshot.
|
java.util.List |
getThreadList()
Returns a list of threads from a snapshot.
|
void |
run()
Updates the instance with new snapshot data.
|
void |
setProcessID(long processID)
Sets a new processID.
|
clone, closeHandle, equals, waitFor, waitFor
asFunction, asFunction, asTypedPointer, castTo, castTo, getDebugInfo, getLength, getValue, hashCode, isNull, read, setValue, toString, write
public Snapshot(Snapshot.Options options)
options
- Portions of the system information to include in the snapshot.public Snapshot(Snapshot.Options options, long processID)
options
- Portions of the system information to include in the snapshot.processID
- Process identifier of the process to be included in the snapshot.public Snapshot.Options getOptions()
public long getProcessID()
public void setProcessID(long processID)
processID
- new processID.public void run()
run
in interface java.lang.Runnable
public java.util.Iterator getProcessIterator()
ProcessEntry
class.public java.util.List getProcesses()
ProcessEntry
class.public java.util.Iterator getModuleIterator()
ModuleEntry
class.public java.util.List getModules()
ModuleEntry
class.public java.util.Iterator getHeapEntriesIterator(long processID, long heapID)
HeapEntry
class.processID
- Identifier of the process context that owns the heap.heapID
- Identifier of the heap to be enumerated.public java.util.List getHeapEntries(long processID, long heapID)
public java.util.Iterator getHeapListIterator()
HeapList
class.public java.util.List getHeapList()
HeapList
class.public java.util.Iterator getThreadIterator()
ThreadEntry
class.public java.util.List getThreadList()
ThreadEntry
class.public void close()