FileChannel在调用了map方法,进行内存映射得到MappedByteBuffer,但是没有提供unmap方法(),释放内存。可以利用工具类来释放MappedByteBuffer。
ByteBufferSupport.unmap(mappedByteBuffer);
mappedByteBuffer = null;
FileChannel在调用了map方法,进行内存映射得到MappedByteBuffer,但是没有提供unmap方法(),释放内存。可以利用工具类来释放MappedByteBuffer。
ByteBufferSupport.unmap(mappedByteBuffer);
mappedByteBuffer = null;