-
- All Superinterfaces:
PlatformManagedObject
public interface BufferPoolMXBean extends PlatformManagedObject
The management interface for a buffer pool, for example a pool ofdirectormappedbuffers.A class implementing this interface is an
MXBean. A Java virtual machine has one or more implementations of this interface. ThegetPlatformMXBeansmethod can be used to obtain the list ofBufferPoolMXBeanobjects representing the management interfaces for pools of buffers as follows:List<BufferPoolMXBean> pools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);The management interfaces are also registered with the platform
MBeanServer. TheObjectNamethat uniquely identifies the management interface within theMBeanServertakes the form:java.nio:type=BufferPool,name=pool namewhere pool name is thenameof the buffer pool.- Since:
- 1.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetCount()Returns an estimate of the number of buffers in the pool.longgetMemoryUsed()Returns an estimate of the memory that the Java virtual machine is using for this buffer pool.StringgetName()Returns the name representing this buffer pool.longgetTotalCapacity()Returns an estimate of the total capacity of the buffers in this pool.-
Methods declared in interface java.lang.management.PlatformManagedObject
getObjectName
-
-
-
-
Method Detail
-
getName
String getName()
Returns the name representing this buffer pool.- Returns:
- The name of this buffer pool.
-
getCount
long getCount()
Returns an estimate of the number of buffers in the pool.- Returns:
- An estimate of the number of buffers in this pool
-
getTotalCapacity
long getTotalCapacity()
Returns an estimate of the total capacity of the buffers in this pool. A buffer's capacity is the number of elements it contains and the value returned by this method is an estimate of the total capacity of buffers in the pool in bytes.- Returns:
- An estimate of the total capacity of the buffers in this pool in bytes
-
getMemoryUsed
long getMemoryUsed()
Returns an estimate of the memory that the Java virtual machine is using for this buffer pool. The value returned by this method may differ from the estimate of the totalcapacityof the buffers in this pool. This difference is explained by alignment, memory allocator, and other implementation specific reasons.- Returns:
- An estimate of the memory that the Java virtual machine is using
for this buffer pool in bytes, or
-1Lif an estimate of the memory usage is not available
-
-