public final class MemoryUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
IS64
JVM architecture.
|
protected static int |
SZ_OBJFOOT
Object footprint - 16 for 64bit, 8 for 32 bit.
|
protected static int |
SZ_OBJLINK
Link to object - 8 for 64bit, 4 for 32bit.
|
Modifier and Type | Method and Description |
---|---|
static long |
calcObjectSize(java.lang.Object obj)
Calculate memory usage for object.
|
static long |
getMemoryAllocated()
Get memory allocated by jvm.
|
static long |
getMemoryLimit()
Get maximum memory which can be allocated by jvm.
|
static long |
getMemoryUsed()
Get memory which used by jvm.
|
protected static long |
getSimpleTypeSize(java.lang.Class<?> oc)
Calculate memory usage for simple types.
|
protected static final boolean IS64
protected static final int SZ_OBJFOOT
protected static final int SZ_OBJLINK
public static long getMemoryUsed()
public static long getMemoryAllocated()
public static long getMemoryLimit()
public static long calcObjectSize(java.lang.Object obj)
obj
- objectjava.lang.Exception
protected static long getSimpleTypeSize(java.lang.Class<?> oc)
oc
- simple type class