lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Configure writer to write to FSDirectory?
Date Sun, 05 Feb 2012 08:14:46 GMT
Hi Cheng,

It seems that you use a RAMDirectory for *caching*, otherwise it makes no
sense to write changes back. In recent Lucene versions, this is not a good
idea, especially for large indexes (RAMDirectory eats your heap space,
allocates millions of small byte[] arrays,...). If you need something like a
caching Directory and you are working on a 64bit platform, you can use
MMapDirectory (where the operating system kernel manages the read/write
between disk an memory). MMapDirectory is returned by default for on most 64 bit platforms. The good thing: the "caching"
space is outside your JVM heap, so does not slowdown the garbage collector.
So be sure to *not* allocate too much heap space (-Xmx) to your search app,
only the minimum needed to execute it and leave the rest of your RAM
available for the OS kernel to manage FS cache.


Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: Cheng []
> Sent: Sunday, February 05, 2012 7:56 AM
> To:
> Subject: Configure writer to write to FSDirectory?
> Hi,
> I build an RAMDirectory on a FSDirectory, and would like the writer
> with the RAMDirectory to periodically write to hard drive.
> Is this achievable?
> Thanks.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message