- All Superinterfaces:
ManagedRuntime
- All Known Implementing Classes:
DTFJJavaRuntime
,JavaRuntime
,JCJavaRuntime
Represents a Java runtime.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.This is short cut method.Get the set of object and class roots known to the VM.getHeaps()
Get the set of heaps known by the VMGet the set of class loaders active in this VMGet the object that represents the virtual machineFetch the JavaVMInitArgs which were used to create this VM.Get any vendor specific properties in use by the JIT for this Java runtimeReturns iterator of the top-level memory categories used by this Java runtime.getMemorySections
(boolean includeFreed) Returns an iterator of JavaRuntimeMemorySection objects corresponding to the blocks of memory allocated by the JavaRuntime.Provides access to the collection of monitors used in the JavaVM.getObjectAtAddress
(ImagePointer address) Gets the object located at addressaddress
in the heap.long
Get the time when the JVM was started.long
Get the value of the JVM's high-resolution timer when the JVM was started.default String
getSystemProperty
(String key) Get a system property of the virtual machine.Get the set of Java threads known by the VMgetTraceBuffer
(String bufferName, boolean formatted) Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) bufferint
hashCode()
Answers an integer hash code for the receiver.boolean
Determine if the JIT was enabled for this Java runtime.Methods declared in interface com.ibm.dtfj.runtime.ManagedRuntime
getFullVersion, getVersion
-
Method Details
-
getJavaVM
Get the object that represents the virtual machine- Returns:
- the address of the JavaVM structure which represents this JVM instance in JNI
- Throws:
CorruptDataException
-
getSystemProperty
Get a system property of the virtual machine.- Parameters:
key
- the name of the property to retrieve- Returns:
- the value of the requested system property from this VM
- Throws:
DataUnavailable
- if the system properties are not availableCorruptDataException
-
getJavaVMInitArgs
Fetch the JavaVMInitArgs which were used to create this VM. See JNI_CreateJavaVM in the JNI Specification for more details.- Returns:
- the JavaVMInitArgs which were used to create this VM.
- Throws:
DataUnavailable
- if the arguments are not availableCorruptDataException
-
getJavaClassLoaders
Iterator getJavaClassLoaders()Get the set of class loaders active in this VM- Returns:
- an iterator of all of the class loaders within this JavaVM
- See Also:
-
getThreads
Iterator getThreads()Get the set of Java threads known by the VM- Returns:
- an iterator of the JavaThreads in the runtime
- See Also:
-
getCompiledMethods
Iterator getCompiledMethods()This is short cut method. The same result can be found by iterating over all methods in all class loaders in all classes.- Returns:
- an iterator over all of the JavaMethods in the JavaRuntime which have been compiled
- See Also:
-
getMonitors
Iterator getMonitors()Provides access to the collection of monitors used in the JavaVM. This collection includes both monitors associated with managed objects (e.g. object monitors) and monitors associated with internal control structures (e.g. raw monitors)- Returns:
- an iterator over the collection of monitors
- See Also:
-
getHeaps
Iterator getHeaps()Get the set of heaps known by the VM- Returns:
- an iterator for all of the Java heaps within this runtime. Heaps may be specific to this JavaVM instance, or may be shared between multiple JavaVM instances
- See Also:
-
getHeapRoots
Iterator getHeapRoots()Get the set of object and class roots known to the VM. Stack frame roots are not included in the set, they can be retrieved using JavaStackFrame.getHeapRoots().- Returns:
- an iterator over the collection of JavaReferences representing the known global heap roots within this runtime.
- See Also:
-
getTraceBuffer
Fetches implementation specific trace buffers, like the verbose GC buffer or the Universal Trace Engine (UTE) buffer- Parameters:
bufferName
- a String naming the buffer to be fetchedformatted
- true if formatting should be performed on the buffer, or false if the raw buffer contents should be returned- Returns:
- an implementation specific result, depending on the parameters
- Throws:
CorruptDataException
-
getObjectAtAddress
JavaObject getObjectAtAddress(ImagePointer address) throws CorruptDataException, IllegalArgumentException, MemoryAccessException, DataUnavailable Gets the object located at addressaddress
in the heap.- Parameters:
address
- theImagePointer
instance representing the start address of object in the heap;- Returns:
- the
JavaObject
instance representing the located object. - Throws:
IllegalArgumentException
- ifaddress
is outside the heap's boundaries, or if it doesn't point to the start location of an object;MemoryAccessException
- ifaddress
is in the heap but it's not accessible from the dump;CorruptDataException
- if any data needed to build the returned instance ofJavaObject
is corrupt.DataUnavailable
- if any data needed to build the returned instance ofJavaObject
is not available.- See Also:
-
getMemoryCategories
Returns iterator of the top-level memory categories used by this Java runtime.- Returns:
- Iterator of memory categories
- Throws:
DataUnavailable
- Since:
- 1.5
- See Also:
-
getMemorySections
Returns an iterator of JavaRuntimeMemorySection objects corresponding to the blocks of memory allocated by the JavaRuntime.- Parameters:
includeFreed
- If true, iterator will iterate over blocks of memory that have been freed, but haven't been re-used yet.- Returns:
- Iterator of memory sections.
- Throws:
DataUnavailable
- Since:
- 1.5
- See Also:
-
equals
Description copied from class:java.lang.Object
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==). -
hashCode
int hashCode()Description copied from class:java.lang.Object
Answers an integer hash code for the receiver. Any two objects which answertrue
when passed to.equals
must answer the same value for this method. -
isJITEnabled
Determine if the JIT was enabled for this Java runtime.- Returns:
- true if the JIT was enabled, false if not
- Throws:
DataUnavailable
- if it is not possible to determine the JIT statusCorruptDataException
- Since:
- 1.8
-
getJITProperties
Get any vendor specific properties in use by the JIT for this Java runtime- Returns:
- the set of properties, which may be empty if none were set.
- Throws:
DataUnavailable
- if the JIT was not enabled for this runtimeCorruptDataException
- Since:
- 1.8
-
getStartTime
Get the time when the JVM was started.- Returns:
- the time the JVM was started, in milliseconds since 1970
- Throws:
DataUnavailable
- if the JVM start time is not availableCorruptDataException
- if the JVM start time is corrupted- Since:
- 1.12
-
getStartTimeNanos
Get the value of the JVM's high-resolution timer when the JVM was started.- Returns:
- the value of the high-resolution timer when the JVM was started, in nanoseconds
- Throws:
DataUnavailable
- if the JVM start time is not availableCorruptDataException
- if the JVM start time is corrupted- Since:
- 1.12
-