public interface MemoryLayoutSpecification
The memory layout for normal Java objects start with an object header which consists of mark and class words plus possible alignment paddings. After the object header, there may be zero or more references to instance fields.
For arrays, the header contains a 4-byte array length in addition to the mark and class word. Array headers might also contain some padding as array base is aligned ( https://bugs.openjdk.org/browse/JDK-8139457),.
ÂObjects are aligned: they always start at some multiple of the alignment.
| Modifier and Type | Method and Description |
|---|---|
int |
getArrayHeaderSize()
Returns the size of the array header.
|
int |
getContendedPaddingWidth()
Returns the number of bytes used to pad the fields/classes annotated with
Contended. |
static MemoryLayoutSpecification |
getEffectiveMemoryLayoutSpecification() |
int |
getObjectAlignment()
Returns the object alignment (padding) in bytes.
|
int |
getObjectHeaderSize()
Returns the size of the object header (mark word + class word).
|
int |
getReferenceSize()
Returns the size of the reference to java objects (also called oops for ordinary object pointers)
|
int getArrayHeaderSize()
The array header is composed of the object header + the array length.
Its size in bytes is equal to getObjectHeaderSize() + 4
int getObjectHeaderSize()
int getObjectAlignment()
The alignment is always a power of 2.
int getReferenceSize()
int getContendedPaddingWidth()
Contended.Contended.static MemoryLayoutSpecification getEffectiveMemoryLayoutSpecification()
Copyright © 2023. All rights reserved.