March 2005
Intermediate to advanced
1254 pages
104h 21m
English
MemoryMXBean
This MXBean interface allows monitoring of current memory usage information for heap memory (allocated objects) and nonheap memory (loaded classes and libraries). It also allows the garbage collector to be explicitly invoked and verbose garbage-collection related output to be turned on or off.
See MemoryUsage for details on how memory usage
information is returned. See also MemoryPoolMXBean
for a way to obtain both current and peak memory usage for individual
memory pools.
public interface MemoryMXBean { // Public Instance Methods void gc( ); MemoryUsage getHeapMemoryUsage( ); MemoryUsage getNonHeapMemoryUsage( ); int getObjectPendingFinalizationCount( ); boolean isVerbose( ); void setVerbose(boolean value); }
ManagementFactory.getMemoryMXBean( )