cowtowncoder/low-gc-membuffers

Add alternative Segment impl that uses simple byte arrays

cowtowncoder opened this issue · 1 comments

Although ByteBuffers are optimal from minimal garbage collection perspective, there are cases where using small number of large byte arrays works pretty well. And since ByteBuffers can have their downsides (wrt clean up, limitations, platform-specific issues), it seems reasonable to allow alternate implementation.
Such implementation is likely to work best when entries are short and total buffer length moderate.

Implemented; used by passing ByteArraySegmentAllocator to MemBuffers, which will then use simple byte[] backed segments for storage.