-
- All Superinterfaces:
MemoryMXBean
,PlatformManagedObject
- All Known Implementing Classes:
ExtendedMemoryMXBeanImpl
public interface MemoryMXBean extends MemoryMXBean
The OpenJ9 extension interface for monitoring the virtual machine's memory management system.- Since:
- 1.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
getCurrentGCThreads()
Returns the number of GC worker threads that participated in the most recent collection.long
getGCMainThreadCpuUsed()
Returns the amount of CPU time spent in the GC by the main thread, in milliseconds.long
getGCMasterThreadCpuUsed()
Deprecated, for removal: This API element is subject to removal in a future version.renamed to getGCMainThreadCpuUsedString
getGCMode()
Returns the current GC mode as a human-readable string.long
getGCSlaveThreadsCpuUsed()
Deprecated, for removal: This API element is subject to removal in a future version.renamed to getGCWorkerThreadsCpuUsedlong
getGCWorkerThreadsCpuUsed()
Returns the total amount of CPU time spent in the GC by all worker threads, in milliseconds.long
getMaxHeapSize()
Get the current maximum heap size in bytes.long
getMaxHeapSizeLimit()
Get the maximum size in bytes to which the max heap size could be increased in the currently running VM.int
getMaximumGCThreads()
Returns the maximum number of GC worker threads.long
getMinHeapSize()
Get the minimum heap size in bytes.long
getSharedClassCacheFreeSpace()
Returns the free space in bytes of the cache that the JVM is currently connected to.long
getSharedClassCacheMaxAotBytes()
Returns the maximum space allowed for AOT data of the cache that the JVM is currently connected to.long
getSharedClassCacheMaxAotUnstoredBytes()
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
getSharedClassCacheMaxJitDataBytes()
Returns the maximum space allowed for JIT data of the cache that the JVM is currently connected to.long
getSharedClassCacheMaxJitDataUnstoredBytes()
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
getSharedClassCacheMinAotBytes()
Returns the minimum space reserved for AOT data of the cache that the JVM is currently connected to.long
getSharedClassCacheMinJitDataBytes()
Returns the minimum space reserved for JIT data of the cache that the JVM is currently connected to.long
getSharedClassCacheSize()
Returns the total size in bytes of the cache that the JVM is currently connected to.long
getSharedClassCacheSoftmxBytes()
Returns the softmx size in bytes of the cache that the JVM is currently connected to.long
getSharedClassCacheSoftmxUnstoredBytes()
Returns the bytes which are not stored into the shared classes cache due to the current setting of softmx in shared classes.boolean
isSetMaxHeapSizeSupported()
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 Detail
-
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
-
getSharedClassCacheSize
long getSharedClassCacheSize()
Returns the total size in bytes of the cache that the JVM is currently connected to.- Returns:
- the number of bytes in the shared class cache.
-
getSharedClassCacheSoftmxBytes
long getSharedClassCacheSoftmxBytes()
Returns the softmx size in bytes of the cache that the JVM is currently connected to.- Returns:
- the softmx bytes in the shared class cache or cache size if it is not set.
-
getSharedClassCacheMinAotBytes
long getSharedClassCacheMinAotBytes()
Returns the minimum space reserved for AOT data of the cache that the JVM is currently connected to.- Returns:
- the minimum shared classes cache space reserved for AOT data in bytes or -1 if it is not set.
-
getSharedClassCacheMaxAotBytes
long getSharedClassCacheMaxAotBytes()
Returns the maximum space allowed for AOT data of the cache that the JVM is currently connected to.- Returns:
- the maximum shared classes cache space allowed for AOT data or -1 if it is not set.
-
getSharedClassCacheMinJitDataBytes
long getSharedClassCacheMinJitDataBytes()
Returns the minimum space reserved for JIT data of the cache that the JVM is currently connected to.- Returns:
- the minimum shared classes cache space reserved for JIT data or -1 if it is not set.
-
getSharedClassCacheMaxJitDataBytes
long getSharedClassCacheMaxJitDataBytes()
Returns the maximum space allowed for JIT data of the cache that the JVM is currently connected to.- Returns:
- the maximum shared classes cache space allowed for JIT data or -1 if it is not set.
-
setSharedClassCacheSoftmxBytes
boolean setSharedClassCacheSoftmxBytes(long value)
Set the shared class softmx size tovalue
. The parameter specifies the softmx in bytes. See -Xscmx in the command line reference for additional details on the effect of setting shared class softmx.- Parameters:
value
- new shared cache soft max value in bytes- Returns:
- whether the requested operation has been completed.
- Throws:
IllegalArgumentException
- if input valuevalue
is less than 0.SecurityException
- if aSecurityManager
is being used and the caller does not have theManagementPermission
value of "control".
-
setSharedClassCacheMinAotBytes
boolean setSharedClassCacheMinAotBytes(long value)
Set the minimum shared classes cache space reserved for AOT data tovalue
bytes. See -Xscminaot in the command line reference for additional details on the effect of setting shared class -Xscminaot.- Parameters:
value
- new -Xscminaot value in bytes- Returns:
- whether the requested operation has been completed.
- Throws:
IllegalArgumentException
- if input valuevalue
is less than 0.SecurityException
- if aSecurityManager
is being used and the caller does not have theManagementPermission
value of "control".
-
setSharedClassCacheMaxAotBytes
boolean setSharedClassCacheMaxAotBytes(long value)
Set the maximum shared classes cache space allowed for AOT data tovalue
bytes. See -Xscmaxaot in the command line reference for additional details on the effect of setting shared class -Xscmaxaot.- Parameters:
value
- new -Xscmaxaot value in bytes- Returns:
- whether the requested operation has been completed.
- Throws:
IllegalArgumentException
- if input valuevalue
is less than 0.SecurityException
- if aSecurityManager
is being used and the caller does not have theManagementPermission
value of "control".
-
setSharedClassCacheMinJitDataBytes
boolean setSharedClassCacheMinJitDataBytes(long value)
Set the minimum shared classes cache space reserved for JIT data tovalue
bytes. See -Xscminjitdata in the command line reference for additional details on the effect of setting shared class -Xscminjitdata.- Parameters:
value
- new -Xscminjitdata value in bytes- Returns:
- whether the requested operation has been completed.
- Throws:
IllegalArgumentException
- if input valuevalue
is less than 0.SecurityException
- if aSecurityManager
is being used and the caller does not have theManagementPermission
value of "control".
-
setSharedClassCacheMaxJitDataBytes
boolean setSharedClassCacheMaxJitDataBytes(long value)
Set the maximum shared classes cache space allowed for JIT data tovalue
bytes. See -Xscmaxjitdata in the command line reference for additional details on the effect of setting shared class -Xscmaxjitdata.- Parameters:
value
- new -Xscmaxjitdata value in bytes- Returns:
- whether the requested operation has been completed.
- Throws:
IllegalArgumentException
- if input valuevalue
is less than 0.SecurityException
- if aSecurityManager
is being used and the caller does not have theManagementPermission
value of "control".
-
getSharedClassCacheSoftmxUnstoredBytes
long getSharedClassCacheSoftmxUnstoredBytes()
Returns the bytes which are not stored into the shared classes cache due to the current setting of softmx in shared classes.- Returns:
- the unstored bytes.
-
getSharedClassCacheMaxAotUnstoredBytes
long getSharedClassCacheMaxAotUnstoredBytes()
Returns the bytes which are not stored into the shared classes cache due to the current setting of maximum space allowed for AOT data.- Returns:
- the unstored bytes.
-
getSharedClassCacheMaxJitDataUnstoredBytes
long getSharedClassCacheMaxJitDataUnstoredBytes()
Returns the bytes which are not stored into the shared classes cache due to the current setting of maximum space allowed for JIT data.- Returns:
- the unstored bytes.
-
getSharedClassCacheFreeSpace
long getSharedClassCacheFreeSpace()
Returns the free space in bytes of the cache that the JVM is currently connected to.- Returns:
- the number of bytes free in the shared class cache.
-
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
-
getGCMasterThreadCpuUsed
@Deprecated(forRemoval=true, since="15") long getGCMasterThreadCpuUsed()
Deprecated, for removal: This API element is subject to removal in a future version.renamed to getGCMainThreadCpuUsedReturns the amount of CPU time spent in the GC by the master thread, in milliseconds.- Returns:
- CPU time used in milliseconds
-
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
-
getGCSlaveThreadsCpuUsed
@Deprecated(forRemoval=true, since="15") long getGCSlaveThreadsCpuUsed()
Deprecated, for removal: This API element is subject to removal in a future version.renamed to getGCWorkerThreadsCpuUsedReturns the total amount of CPU time spent in the GC by all slave threads, 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
-
-