Stdlib index
- Captured-borrow migration worklist (3.3.3)
- Owned-bind migration worklist (8.2.7)
- Return-side title audit — the ride-through enumeration
- stdlib ownership audit
- stdlib ownership dispositions (plan 1.3.1 / 4.3.1)
aot
codec
codec / csv
codec / json
collection
- ArrayList
- BPlusTree
- Cache
- Collectors
- HashMap
- HashSet
- Heap
- ImmutableList
- ImmutableMap
- ImmutableSet
- LinkedList
- RedBlackTree
- Sort
collection / ltm
concurrent
error
- Exception
- NoOptionalValueException
- NotProvidedException
- RecoverableException
- ScopedBuildFailedException
- ScopeNotActiveException
- Throwable
- UnrecoverableException
gfx
hash
ifx
io
io / file
io / net
io / net / dns
io / net / uri
lang
lang / stream
math
math / fft
math / linalg
math / npio
math / poly
math / random
math / stats
nucleo
- Columns — the Arrow-laid-out substrate
- Fused tensor expressions — Fuse
- Table — the lazy, typed dataframe
- Tape — define-by-run autograd
- Transform intrinsics — Grad, Vmap, Jit
process
reflect
search / distance
search / fuzzy
search / ngram
session
time
- Clock
- DateTimeFormatter
- Duration
- Instant
- LocalDate
- LocalDateTime
- LocalTime
- Period
- ZonedDateTime
- ZoneId
- ZoneOffset
wire
xpu
xpu / mesh
BufferPool
cajeta.io.net.BufferPool — a bounded free list of same-sized
ByteBuffers. A server acquires one input and one output
buffer per connection at accept and releases both at close, so a warm server
allocates nothing per request. allocations() counts fresh buffers ever
made, which is the gauge a steady-state test asserts flat. Idle buffers past
maxIdle are dropped on release rather than kept.
BufferPool pool = heap BufferPool(65536, 64);
ByteBuffer in #= pool.acquire();
ByteBuffer out #= pool.acquire();
pool.release(#in);
pool.release(#out);
Methods
| Signature | |
|---|---|
BufferPool(int32 slabSize, int32 maxIdle) | Every buffer is slabSize bytes; at most maxIdle sit idle |
#ByteBuffer acquire() | An idle buffer cleared, or a fresh one counted in allocations() |
void release(#ByteBuffer buf) | Take the buffer back; kept idle up to maxIdle, dropped past it, and a buffer of another size is never kept |
int32 bufferSize() / int32 idle() / int32 maxIdleCount() | The slab size, the idle count, the idle cap |
int32 allocations() | Fresh buffers made since construction |
See also
- ByteBuffer — the unit it hands out
- Source:
runtime/src/cajeta/io/net/BufferPool.cajeta