Enum Constant and Description |
---|
COUNT
Object count
|
JDK32
32-bit JDK
|
JDK64Compressed
64-bit JDK with -XX:+UseCompressedOops
|
JDK64Uncompressed
64-bit JDK with -XX:-UseCompressedOops
|
Modifier and Type | Method and Description |
---|---|
static ObjSize |
current()
Returns ObjSize for this JVM.
|
long |
sizeOf(java.lang.Object o)
Return aligned size of object in bytes.
|
long |
sizeOfArray(java.lang.Class componentCls,
int len)
Return aligned size of array in bytes
|
long |
sizeOfClassInstance(java.lang.Class cls)
Calculate aligned size of objects of specified class
|
static ObjSize |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ObjSize[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ObjSize COUNT
public static final ObjSize JDK32
public static final ObjSize JDK64Compressed
public static final ObjSize JDK64Uncompressed
public static ObjSize[] values()
for (ObjSize c : ObjSize.values()) System.out.println(c);
public static ObjSize valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic long sizeOf(java.lang.Object o)
o
- the Objectpublic long sizeOfClassInstance(java.lang.Class cls)
cls
- specified classjava.lang.IllegalArgumentException
- if specified class is array classpublic long sizeOfArray(java.lang.Class componentCls, int len)
componentCls
- type of elementslen
- array lengthpublic static ObjSize current()