[GitHub] franz1981 edited a comment on issue #2250: ARTEMIS-1996 MappedSequentialFileFactory may cause DirectByteBuffer off-heap memory leaks

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] franz1981 edited a comment on issue #2250: ARTEMIS-1996 MappedSequentialFileFactory may cause DirectByteBuffer off-heap memory leaks

GitBox
franz1981 edited a comment on issue #2250: ARTEMIS-1996 MappedSequentialFileFactory may cause DirectByteBuffer off-heap memory leaks
URL: https://github.com/apache/activemq-artemis/pull/2250#issuecomment-454285382
 
 
   @CNNJYB in this case it is wanted: compaction was leaking buffers big as the file size, while with paging not ie it shouldn't.
   The point is that a thread local pool buffer is not a perfect solution, but is better then no pooling (using heap buffers and FileChannel means that FileChannel will leak a direct ByteBuffer and will perform an hidden copy) or a shared (among threads) pool.
   We can rethink pooling according to the lifecycle of who perform the page write: any proposal is welcome to solve it and we can work on a solution together :)
   Just to mention: consider that using a lock-free data-structure could be a solution too (using a fixed size `AtomicReferenceArray`) and we could bounds the life-cycle of the pool to the lifecycle of the file factory.
   If a factory::close would happen we could just cleanup it...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services