Expand description
Buffer pool for reusable byte buffers organized by size class.
The buffer pool eliminates frequent heap allocations by maintaining free lists
of pre-allocated buffers. When a PooledBuffer is dropped it is automatically
returned to the pool for future reuse.
§Size classes
Buffers are grouped into nine size classes (in bytes): 4 KB, 8 KB, 16 KB, 32 KB, 64 KB, 128 KB, 256 KB, 512 KB, 1 MB.
Structs§
- Buffer
Pool - A pool of reusable byte buffers organized by size class.
- Buffer
Pool Stats - Snapshot of
BufferPoolcounters. - Pooled
Buffer - A byte buffer borrowed from a
BufferPool.