I have a memory leak that I have isolated to incorrectly disposed direct byte buffers.
ByteBuffer buff = ByteBuffer.allocateDirect(7777777)
The GC collects the objects that harbor these buffers but does not dispose of the buffer itself. If I instantiate enough of the transient objects containing buffers I get this encouraging message.
java.lang.OutOfMemoryError: Direct buffer memory
I have been searching up this problem and apparently
buff.clear
and
System.gc()
does not work