< prev index next >
src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
Print this page
rev 58228 : 8238665: Add JFR event for direct memory statistics
*** 39,48 ****
--- 39,49 ----
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import jdk.internal.access.JavaNioAccess;
import jdk.internal.access.SharedSecrets;
+ import jdk.internal.misc.VM;
import java.util.ArrayList;
import java.util.List;
import java.lang.reflect.UndeclaredThrowableException;
*** 338,354 ****
}
private static List<BufferPoolMXBean> bufferPools = null;
public static synchronized List<BufferPoolMXBean> getBufferPoolMXBeans() {
if (bufferPools == null) {
! bufferPools = new ArrayList<>(2);
! bufferPools.add(createBufferPoolMXBean(SharedSecrets.getJavaNioAccess()
! .getDirectBufferPool()));
! bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
! .getMappedBufferPool()));
! bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
! .getSyncMappedBufferPool()));
}
return bufferPools;
}
private final static String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool";
--- 339,350 ----
}
private static List<BufferPoolMXBean> bufferPools = null;
public static synchronized List<BufferPoolMXBean> getBufferPoolMXBeans() {
if (bufferPools == null) {
! bufferPools = new ArrayList<>(3);
! VM.getBufferPools().forEach(pool -> bufferPools.add(createBufferPoolMXBean(pool)));
}
return bufferPools;
}
private final static String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool";
< prev index next >