-
- All Superinterfaces:
- PlatformManagedObject
public interface BufferPoolMXBean extends PlatformManagedObject
The management interface for a buffer pool, for example a pool ofdirect
ormapped
buffers.A class implementing this interface is an
MXBean
. A Java virtual machine has one or more implementations of this interface. ThegetPlatformMXBeans
method can be used to obtain the list ofBufferPoolMXBean
objects 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
. TheObjectName
that uniquely identifies the management interface within theMBeanServer
takes the form:java.nio:type=BufferPool,name=pool name
where pool name is thename
of the buffer pool.- Since:
- 1.7
-
-
Method Summary
Methods Modifier and Type Method and Description long
getCount()
Returns an estimate of the number of buffers in the pool.long
getMemoryUsed()
Returns an estimate of the memory that the Java virtual machine is using for this buffer pool.String
getName()
Returns the name representing this buffer pool.long
getTotalCapacity()
Returns an estimate of the total capacity of the buffers in this pool.-
Methods inherited from 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 totalcapacity
of 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
-1L
if an estimate of the memory usage is not available
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-java/lang/management/bufferpoolmxbean.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.