Interface MemoryMXBean
- All Superinterfaces:
MemoryMXBean
,PlatformManagedObject
- All Known Implementing Classes:
ExtendedMemoryMXBeanImpl
The OpenJ9 extension interface for monitoring the virtual machine's memory
management system.
- Since:
- 1.5
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the number of GC worker threads that participated in the most recent collection.long
Returns the amount of CPU time spent in the GC by the main thread, in milliseconds.Returns the current GC mode as a human-readable string.long
Returns the total amount of CPU time spent in the GC by all worker threads, in milliseconds.long
Get the current maximum heap size in bytes.long
Get the maximum size in bytes to which the max heap size could be increased in the currently running VM.int
Returns the maximum number of GC worker threads.long
Get the minimum heap size in bytes.long
Returns the free space in bytes of the cache that the JVM is currently connected to.long
Returns the maximum space allowed for AOT data of the cache that the JVM is currently connected to.long
Returns the bytes which are not stored into the shared classes cache due to the current setting of maximum space allowed for AOT data.long
Returns the maximum space allowed for JIT data of the cache that the JVM is currently connected to.long
Returns the bytes which are not stored into the shared classes cache due to the current setting of maximum space allowed for JIT data.long
Returns the minimum space reserved for AOT data of the cache that the JVM is currently connected to.long
Returns the minimum space reserved for JIT data of the cache that the JVM is currently connected to.long
Returns the total size in bytes of the cache that the JVM is currently connected to.long
Returns the softmx size in bytes of the cache that the JVM is currently connected to.long
Returns the bytes which are not stored into the shared classes cache due to the current setting of softmx in shared classes.boolean
Query whether the VM supports runtime reconfiguration of the maximum heap size through the setMaxHeapSize() call.void
setMaxHeapSize
(long size) Set the current maximum heap size tosize
.boolean
setSharedClassCacheMaxAotBytes
(long value) Set the maximum shared classes cache space allowed for AOT data tovalue
bytes.boolean
setSharedClassCacheMaxJitDataBytes
(long value) Set the maximum shared classes cache space allowed for JIT data tovalue
bytes.boolean
setSharedClassCacheMinAotBytes
(long value) Set the minimum shared classes cache space reserved for AOT data tovalue
bytes.boolean
setSharedClassCacheMinJitDataBytes
(long value) Set the minimum shared classes cache space reserved for JIT data tovalue
bytes.boolean
setSharedClassCacheSoftmxBytes
(long value) Set the shared class softmx size tovalue
.Methods declared in interface java.lang.management.MemoryMXBean
gc, getHeapMemoryUsage, getNonHeapMemoryUsage, getObjectPendingFinalizationCount, isVerbose, setVerbose
Methods declared in interface java.lang.management.PlatformManagedObject
getObjectName
-
Method Details
-
getMaxHeapSizeLimit
long getMaxHeapSizeLimit()Get the maximum size in bytes to which the max heap size could be increased in the currently running VM. This may be larger than the current max heap size.- Returns:
- value of -Xmx in bytes
-
getMaxHeapSize
long getMaxHeapSize()Get the current maximum heap size in bytes.- Returns:
- current value of -Xsoftmx in bytes
-
getMinHeapSize
long getMinHeapSize()Get the minimum heap size in bytes.- Returns:
- value of -Xms in bytes
-
setMaxHeapSize
void setMaxHeapSize(long size) Set the current maximum heap size tosize
. The parameter specifies the max heap size in bytes and must be between getMinHeapSize() and getMaxHeapSizeLimit(). See -Xsoftmx in the command line reference for additional details on the effect of setting softmx.- Parameters:
size
- new -Xsoftmx value in bytes- Throws:
UnsupportedOperationException
- if this operation is not supported.IllegalArgumentException
- if input valuesize
is either less than getMinHeapSize() or greater than getMaxHeapSizeLimit().SecurityException
- if aSecurityManager
is being used and the caller does not have theManagementPermission
value of "control".
-
isSetMaxHeapSizeSupported
boolean isSetMaxHeapSizeSupported()Query whether the VM supports runtime reconfiguration of the maximum heap size through the setMaxHeapSize() call.- Returns:
- true if setMaxHeapSize is supported, false otherwise
-
getGCMode
String getGCMode()Returns the current GC mode as a human-readable string.- Returns:
- a String describing the mode the GC is currently operating in
-
getGCMainThreadCpuUsed
long getGCMainThreadCpuUsed()Returns the amount of CPU time spent in the GC by the main thread, in milliseconds.- Returns:
- CPU time used in milliseconds
-
getGCWorkerThreadsCpuUsed
long getGCWorkerThreadsCpuUsed()Returns the total amount of CPU time spent in the GC by all worker threads, in milliseconds.- Returns:
- CPU time used in milliseconds
-
getMaximumGCThreads
int getMaximumGCThreads()Returns the maximum number of GC worker threads.- Returns:
- maximum number of GC worker threads
-
getCurrentGCThreads
int getCurrentGCThreads()Returns the number of GC worker threads that participated in the most recent collection.- Returns:
- number of active GC worker threads
-