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: [email protected] With regards, Apache Git Services
