ehcache / ehcache3

Ehcache 3.x line
http://www.ehcache.org
Apache License 2.0
2k stars 578 forks source link

[Question] Usage of heap byte buffers in disk cache #3226

Open sgup432 opened 3 months ago

sgup432 commented 3 months ago

Hi, I am using ehcache as a pure disk cache. I see that you folks are using heap byte buffers to read from file channels by doing below

ByteBuffer buffer) = ByteBuffer.allocate(length);
channel.read(buffer);

I wanted to why MappedByteBuffer was not the obvious choice while reading from the file which has its benefits by mapping section of file onto memory? Considering heap byte buffers requires extra copy from direct buffer to heap buffer and may have performance impact?