0

I am using Lucene's MMapDirectory to keep index files in memory mapped files. According to the output of pmap command, only part of these files actually reside in the physical memory. I would like to put more RAM to the server and make sure that the all files are completely in the memory. However, the extra RAM will be proportionally distributed. In a Linux system, can I reserve some physical memory specifically for these files (which are about 5GB in total).

Thanks in advance for your answers.

murat
  • 63
  • 1
  • 4

1 Answers1

0

I'm afraid there aren't any decent out-of-the-box solutions available at the moment.

You could use RAMDirectory which is closest to what you are looking for, but it is not efficient (too much ram gets allocated, GC slowness, etc.). There's LUCENE-3659 to improve this, but it's not ready yet.

You could look at ramfs/tmpfs, but both of them are volatile (index goes away after switching the machine off), also you could end up in situations where RAM gets cached in another RAM.

More info: http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit.html

mindas
  • 26,463
  • 15
  • 97
  • 154