|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.utils.Allocator
org.apache.cassandra.utils.SlabAllocator
public class SlabAllocator
The SlabAllocator is a bump-the-pointer allocator that allocates large (2MB by default) regions and then doles them out to threads that request slices into the array.
The purpose of this class is to combat heap fragmentation in long lived objects: by ensuring that all allocations with similar lifetimes only to large regions of contiguous memory, we ensure that large blocks get freed up at the same time. Otherwise, variable length byte arrays allocated end up interleaved throughout the heap, and the old generation gets progressively more fragmented until a stop-the-world compacting collection occurs.
Constructor Summary | |
---|---|
SlabAllocator()
|
Method Summary | |
---|---|
java.nio.ByteBuffer |
allocate(int size)
|
Methods inherited from class org.apache.cassandra.utils.Allocator |
---|
clone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SlabAllocator()
Method Detail |
---|
public java.nio.ByteBuffer allocate(int size)
allocate
in class Allocator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |