@InterfaceAudience.Private @InterfaceStability.Evolving public class DirectMemoryUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static MBeanServer |
BEAN_SERVER |
private static boolean |
HAS_MEMORY_USED_ATTRIBUTE |
private static org.slf4j.Logger |
LOG |
private static String |
MEMORY_USED |
private static ObjectName |
NIO_DIRECT_POOL |
Constructor and Description |
---|
DirectMemoryUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
destroyDirectByteBuffer(ByteBuffer toBeDestroyed)
DirectByteBuffers are garbage collected by using a phantom reference and a reference queue.
|
static long |
getDirectMemorySize() |
static long |
getDirectMemoryUsage()
Returns the current amount of direct memory used.
|
static long |
getNettyDirectMemoryUsage()
Returns the current amount of direct memory used by netty module.
|
private static final org.slf4j.Logger LOG
private static final String MEMORY_USED
private static final MBeanServer BEAN_SERVER
private static final ObjectName NIO_DIRECT_POOL
private static final boolean HAS_MEMORY_USED_ATTRIBUTE
public DirectMemoryUtils()
public static long getDirectMemorySize()
public static long getDirectMemoryUsage()
public static long getNettyDirectMemoryUsage()
public static void destroyDirectByteBuffer(ByteBuffer toBeDestroyed) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.