Memory Types
FixedMemory
public final class FixedMemory extends AbstractMemory {
private final MemorySegment segment; // Final - never changes
public FixedMemory(MemorySegment segment);
}Characteristics
Lifecycle
Pool Creation:
SlabAllocator allocates bulk memory
↓
new FixedMemory(segment) ← Bound permanently
↓
Added to pool free-list
Hot Path:
pool.allocate() → FixedMemory
↓
Reset start/end bounds only (NO rebinding)
↓
Use for packet processing
↓
packet.recycle() → back to free-listWhen to Use
ScopedMemory
Characteristics
Zero-Copy Pattern
When to Use
Comparison
Aspect
FixedMemory
ScopedMemory
AbstractMemory Base Class
PoolEntry Integration
Last updated