public class UnsafeUtil extends Object
| 构造器和说明 |
|---|
UnsafeUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
addressOf(Object o)
Get the memory address of the given object.
|
static long |
getHeaderSize() |
static sun.misc.Unsafe |
getUnsafe() |
static boolean |
isUsecompressedOops()
Determined whether the vm use -XX:+UseCompressedOops.
|
static long |
refSize()
Get the size of reference.
|
static long |
refSizeOf(Class<?> clz)
Get the size of reference.
|
static long |
shallowSizeOf(Class<?> clz)
Measure the SHALLOW size of the given class's instance.
|
static long |
shallowSizeOf(Object o)
SHALLOW size of the given object.
|
static long |
sizeOf(Object o)
HEAP size of the given object.
|
public static sun.misc.Unsafe getUnsafe()
public static long addressOf(Object o)
o - public static long shallowSizeOf(Class<?> clz)
shallowSizeOf(Object).clz - public static long shallowSizeOf(Object o)
shallowSizeOf(Class).o - public static long sizeOf(Object o)
shallowSizeOf(Class).o - public static long refSize()
Unsafe.addressSize()public static long refSizeOf(Class<?> clz)
clz - public static long getHeaderSize()
public static boolean isUsecompressedOops()
Copyright © 2018. All rights reserved.