cowtowncoder/low-gc-membuffers — Issue #10: Improve deallocation of direct ByteBuffers using sun.misc.Unsafe?
Author: cowtowncoder
Created: 2011-12-10 18:06:36+00:00
State: open

Apparently deallocation of direct-allocated ByteBuffers is bit tricky, since underlying off-heap buffers are NOT necessarily freed in timely manner, partly since there is no mechanism to force deallocation. As such they might only be collected when GC kicks in.

However there is apparently a way to force freeing using sun.misc.Unsafe. If so, we should probably try to use that mechanism to reduce likelihood of OOMEs caused by delayed deallocation.