public interface MemoryMXBean extends PlatformManagedObject
Precisely one instance of this interface will be made available to management clients.
Accessing this MXBean
can be done in one of three ways.
ManagementFactory.getMemoryMXBean()
method.
MBeanServerConnection
.ManagementFactory.newPlatformMXBeanProxy(javax.management.MBeanServerConnection, java.lang.String, java.lang.Class<T>)
method, passing in the
string "java.lang:type=ClassLoading" for the value of the second
parameter.Modifier and Type | Method and Description |
---|---|
void |
gc()
Requests the virtual machine to run the system garbage collector.
|
MemoryUsage |
getHeapMemoryUsage()
Returns the current memory usage of the heap for both live objects and
for objects no longer in use which are awaiting garbage collection.
|
MemoryUsage |
getNonHeapMemoryUsage()
Returns the current non-heap memory usage for the virtual machine.
|
int |
getObjectPendingFinalizationCount()
Returns the number of objects in the virtual machine that are awaiting
finalization.
|
boolean |
isVerbose()
Returns a boolean indication of whether or not the memory system is
producing verbose output.
|
void |
setVerbose(boolean value)
Updates the verbose output setting of the memory system.
|
getObjectName
void gc()
MemoryUsage getHeapMemoryUsage()
MemoryUsage
which can be interrogated by
the caller.MemoryUsage getNonHeapMemoryUsage()
MemoryUsage
which can be interrogated by
the caller.int getObjectPendingFinalizationCount()
boolean isVerbose()
true
if verbose output is being produced ;
false
otherwise.void setVerbose(boolean value)
value
- true
enables verbose output ;
false
disables verbose output.SecurityException
- if a SecurityManager
is being used and the caller
does not have the ManagementPermission
value
of "control".ManagementPermission
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1993, 2025 IBM Corp. and others.