Hi,

In Lucene 7.7 you can use ByteBuffersDirectory, the default constructor behaves 
like RAMDirectory (allocates on heap), but has much better concurrency and 
garbage collection behaviour (no millions of byte[8192] instances holding the 
data)
http://lucene.apache.org/core/7_7_0/core/org/apache/lucene/store/ByteBuffersDirectory.html

By using the complex constructor you can also make it behave funny things like 
allocation of DirectBuffers off-heap (using Java's ByteBuffer::allocateDirect 
method passed as reference to ByteBuffersDataOutput blockAllocate parameter) or 
similar stuff. But when doing this you are on your own.

Nevertheless, MMapDirectory on a Linux "tmpfs" filesystem is the better choice 
for most use cases.

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: Jonathan Willis <quicksilver...@gmail.com>
> Sent: Wednesday, February 27, 2019 12:19 AM
> To: java-user@lucene.apache.org
> Subject: in memory lucene
> 
> Hi, i'm looking into using Lucene 7.7.0 and noticed that the RAMDirectory
> has been deprecated because of inefficient synchronization issues and that
> we are encouraged to use MMapDirectory instead. I was hoping to use an in
> memory only directory and was wondering if that would be possible without
> RAMDirectory? How would I go about doing this?
> 
> Thank you
> --
> Jonathan Willis


---------------------------------------------------------------------
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