Re: How to delete direct Buffers?
Posted by
Sven Gothel on
Nov 27, 2014; 8:34pm
URL: https://forum.jogamp.org/How-to-delete-direct-Buffers-tp4033631p4033659.html
On 11/27/2014 03:30 PM, Vasilij [via jogamp] wrote:
I have also employed sun.misc.Cleaner methods
in GlueGen's MappedByteBufferInputStream:
com.jogamp.common.nio.MappedByteBufferInputStream
Intent is to use memory mapped NIO files
as InputStream and OutputStream while overcoming
the NIO buffer 'int' address range.
See unit tests:
com.jogamp.common.nio.TestByteBufferInputStream
com.jogamp.common.nio.TestByteBufferOutputStream
com.jogamp.common.nio.TestByteBufferCopyStream
Result of using the 'cleaner' depends on the implementing platform,
however, 'htop' and other heap monitors show that the
mapped memory is released.
Hope it helps a bit.
~Sven