ehcache / ehcache3

Ehcache 3.x line

Home Page:http://www.ehcache.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Usage of heap byte buffers in disk cache

sgup432 opened this issue · comments

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?