I read this article "Use Lucene's MMapDirectory on 64bit platforms, please!" 
and it said the MMapDirectory is better than other Directory because it will 
void copy data between file system cache and java heap.
 
I checked the source code of NIOFSDirectory, and in new Buffer method it called 
"ByteBuffer.wrap(newBuffer)", the generated ByteBuffer is HeapByteBuffer. And 
it will indeed copy data between file system cache and java heap. Why not use 
ByteBuffer.allocateDirect to generate DirectyByteBuffer, and it will store data 
directly in file sysytem cache, not java heap. If in this case , what is the 
different in performance between NIO and MMap?  Or allocate directy memory in 
still slower than Mmap?
 
Maybe I made some misunderstanding of lucene code, thank you for any suggestion 
in advance.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to