Re: Perf comparision for MMapDirectory Vs NIOFSDirectory

2025-05-23 Thread ashwini singh
Thanks! On Wed, 21 May 2025 at 23:35, Adrien Grand wrote: > Hello Ashwini, > > MMapDirectory will often perform a bit faster. While NIOFSDirectory needs > to first copy data from the buffer cache to heap arrays, MMapDirectory can > read directly into the buffer cache. > &g

Re: Perf comparision for MMapDirectory Vs NIOFSDirectory

2025-05-21 Thread Adrien Grand
Hello Ashwini, MMapDirectory will often perform a bit faster. While NIOFSDirectory needs to first copy data from the buffer cache to heap arrays, MMapDirectory can read directly into the buffer cache. Lucene's benchmark suite allows comparing these two directories. I haven't done s

Perf comparision for MMapDirectory Vs NIOFSDirectory

2025-05-21 Thread ashwini singh
As per Lucene documentation there is not much difference between these 2 implementations and users should use the Open() method and Lucene choses the best implementation based on the system. https://lucene.apache.org/core/9_7_0/core/org/apache/lucene/store/FSDirectory.html Is there any perf impa

回复: 回复:RE: why lucene not use DirectByteBuffer in NIOFSDirectory

2013-08-07 Thread wangzhijiang999
nfusings.   - 原邮件 - 发件人: Uwe Schindler 收件人: java-user@lucene.apache.org 抄送: 发送日期: 2013年8月7日, 星期三, 1:17 下午 主题: RE: 回复:RE: why lucene not use DirectByteBuffer in NIOFSDirectory Hi, 1) ByteBuffer bb=ByteBuffer.wrap(new byte[len]);  //bb is HeapByteBuffer     channel.read

RE: 回复:RE: why lucene not use DirectByteBuffer in NIOFSDirectory

2013-08-07 Thread Uwe Schindler
ijiang...@aliyun.com [mailto:wangzhijiang...@aliyun.com] Sent: Wednesday, August 07, 2013 11:36 AM To: java-user Subject: 回复:RE: why lucene not use DirectByteBuffer in NIOFSDirectory Hi Uwe: Thank you for your detail explaination and I learnt a lot from your message. First, the direct

回复:RE: why lucene not use DirectByteBuffer in NIOFSDirectory

2013-08-07 Thread wangzhijiang999
---发件人:Uwe Schindler发送日期:2013年7月31日 18:18收件人:java-user@lucene.apache.org;wangzhijiang...@yahoo.com.cn;主 题:RE: why lucene not use DirectByteBuffer in NIOFSDirectory Hi,There is a misunderstanding: Just by allocating a direct buffer, there is still no difference to a heap buffer in the workflo

RE: why lucene not use DirectByteBuffer in NIOFSDirectory

2013-07-31 Thread Uwe Schindler
es as used by Lucene. - NIOFSDirectory with direct buffers: Needs to copy data from FS cache to direct buffer memory (outside heap). Access times slower to direct buffers than to heap buffers -> 2 times bad - NIOFSDirectory with heap buffers: Needs to copy data from FS cache to heap. Access t

why lucene not use DirectByteBuffer in NIOFSDirectory

2013-07-31 Thread wangzhijiang999
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 m

Re: Explicit setting of NIOFSDirectory not respected

2012-12-12 Thread Neil Ireson
"NIOFSDirectory.open(File)" only opens a NIOFSDirectory and has the same semantics as "new NIOFSDirectory(File)", which is what I would expect. Obviously there is the Java weirdness that using FSDirectory nioFSDirectory = new NIOFSDirectory();, then nioFSDirectory.open() will call FS

RE: Explicit setting of NIOFSDirectory not respected

2012-12-12 Thread Uwe Schindler
Hi, > Thanks for that, I had not realised that the open method was simply > inherited from the FSDirectory, I should have read the docs. > > However, it makes no sense to me that a call to NIOFSDirectory.open() can > end up opening a MMapDirectory, and in general that a call to one subclass > can

RE: Explicit setting of NIOFSDirectory not respected

2012-12-12 Thread Neil Ireson
Thanks for that, I had not realised that the open method was simply inherited from the FSDirectory, I should have read the docs. However, it makes no sense to me that a call to NIOFSDirectory.open() can end up opening a MMapDirectory, and in general that a call to one subclass can end up openin

RE: Explicit setting of NIOFSDirectory not respected

2012-12-12 Thread Uwe Schindler
If you want a specific directory implementation, instantiate it directly (new NIOFSDirectory)? If you use FSDirectory.open() it will use the autodetected one depending on OS and bitness. About configuring your server from MMAP in a correct way, read http://blog.thetaphi.de/2012/07/use-lucenes

Explicit setting of NIOFSDirectory not respected

2012-12-12 Thread Neil Ireson
Hi all, I run my code on a cluster where I have to preset resource limits and therefore the processes have limited virtual memory causing OOME when using MMapDirectory on large indexes. This means I explicitly use NIOFSDirectory (i.e. Directory indexDirectory = NIOFSDirectory.open(indexFile

Re: Direct memory footprint of NIOFSDirectory

2012-07-13 Thread Vitaly Funstein
for IndexWriter to work. This was >>> essentially caused by the embedding application making heavy use of JVM's >>> direct memory buffers and not leaving enough headroom for NIOFSDirectory to >>> operate. So what are the approximate guidelines, if any, in terms of JVM &g

Re: Direct memory footprint of NIOFSDirectory

2012-07-12 Thread Lance Norskog
of JVM's >> direct memory buffers and not leaving enough headroom for NIOFSDirectory to >> operate. So what are the approximate guidelines, if any, in terms of JVM >> configuration for this choice of Directory to operate safely? Basically, >> what I am looking for is a rou

Re: Direct memory footprint of NIOFSDirectory

2012-07-12 Thread Vitaly Funstein
rect memory available for IndexWriter to work. This was essentially > caused by the embedding application making heavy use of JVM's direct memory > buffers and not leaving enough headroom for NIOFSDirectory to operate. So > what are the approximate guidelines, if any, in terms of JVM configura

Direct memory footprint of NIOFSDirectory

2012-07-09 Thread Vitaly Funstein
Hello, I have recently run into the situation when there was not a sufficient amount of direct memory available for IndexWriter to work. This was essentially caused by the embedding application making heavy use of JVM's direct memory buffers and not leaving enough headroom for NIOFSDirecto

Re: NIOFSDirectory and Thread.interrupt

2011-10-16 Thread Simon Willnauer
normally(without > interrupt). I also tried to put some Thread.sleep() on end of run(), but > still it didn't help. > Finally i solved the problem by making mythread reusable. This is not > perfect solution for me, but for now it's w

NIOFSDirectory and Thread.interrupt

2011-10-16 Thread Grzegorz Tańczyk
RLClassLoader Conclusion is that you can't access NIOFSDirectory in thread which will end normally or by interrupt. It happened in 3.3.0. Thanks -- Regards - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For a

RE: NIOFSDirectory AssertionError in sun.nio.ch.NativeThreadSet

2009-12-06 Thread Uwe Schindler
hetaphi.de > -Original Message- > From: dcli...@gmail.com [mailto:dcli...@gmail.com] On Behalf Of Dan > Sent: Sunday, December 06, 2009 9:30 PM > To: java-user@lucene.apache.org > Subject: NIOFSDirectory AssertionError in sun.nio.ch.NativeThreadSet > > I've been run

NIOFSDirectory AssertionError in sun.nio.ch.NativeThreadSet

2009-12-06 Thread Dan
I've been running some tests with Lucene 2.9.1 on a Linux box with a Sun JVM and getting a sun.nio.ch.NateiveThreadSet Assertion error (see below for stacktrace). Does anyone know what this error means? Any suggestions for a workaround? We used the following to open the index. FSDirectory

Re: NIOFSDirectory

2008-12-05 Thread Wouter Heijke
> Use this constructor to create an instance of NIODirectory: >> >> /** Create a new NIOFSDirectory for the named location. >> * >> * @param path the path of the directory >> * @param lockFactory the lock factory to use, or null for the default. >> * @t

Re: NIOFSDirectory

2008-12-05 Thread Glen Newton
Understood. Thanks! :-) -glen 2008/12/4 John Wang <[EMAIL PROTECTED]>: > NIOFSDirectory.getDirectory simple calls the static method on the parent > class: FSDirectory.getDirectory. > Which returns an instance of FSDirectory. > > IMO: NIOFSDirectory solves concurrent read pr

Re: NIOFSDirectory

2008-12-04 Thread John Wang
NIOFSDirectory.getDirectory simple calls the static method on the parent class: FSDirectory.getDirectory. Which returns an instance of FSDirectory. IMO: NIOFSDirectory solves concurrent read problems, generally you don't want concurrent writes. -John On Thu, Dec 4, 2008 at 2:44 PM, Glen N

Re: NIOFSDirectory

2008-12-04 Thread Glen Newton
Am I missing something here? Why not use: IndexWriter writer = new IndexWriter(NIOFSDirectory.getDirectory(new File(filename), analyzer, true); Another question: is NIOFSDirectory to be used with IndexWriter? If no, could someone explain? thanks, -glen 2008

Re: NIOFSDirectory

2008-12-04 Thread John Wang
Thanks! -John On Thu, Dec 4, 2008 at 2:16 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote: > Details in the bug: > https://issues.apache.org/jira/browse/LUCENE-1451 > > Use this constructor to create an instance of NIODirectory: > > /** Create a new NIOFSDirector

Re: NIOFSDirectory

2008-12-04 Thread Wouter Heijke
gt; a map FSDirectory keeps statically. Should subclasses of FSDirectory be > modifying the map? > This is not a question about how to subclass or customize FSDirectory. > This > is more on how to use NIOFSDirectory class. I am hoping for a simply > answer, > is what I am doing (setting t

Re: NIOFSDirectory

2008-12-04 Thread Yonik Seeley
Details in the bug: https://issues.apache.org/jira/browse/LUCENE-1451 Use this constructor to create an instance of NIODirectory: /** Create a new NIOFSDirectory for the named location. * * @param path the path of the directory * @param lockFactory the lock factory to use, or null for

Re: NIOFSDirectory

2008-12-04 Thread John Wang
That does not help. The File/path is not stored with the instance. It is in a map FSDirectory keeps statically. Should subclasses of FSDirectory be modifying the map? This is not a question about how to subclass or customize FSDirectory. This is more on how to use NIOFSDirectory class. I am hoping

Re: NIOFSDirectory

2008-12-04 Thread Yonik Seeley
>>> we are running, performance improved by a factor of 5 (to be conservative). >>> >>> Great job, this is awesome, a simple change and made a huge difference. >>> >>>To get NIOFSDirectory installed, I didn't find any documentati

Re: NIOFSDirectory

2008-12-04 Thread John Wang
version 2.4, sorry for not clarifying. Yonik, pardon my ignorance. I still don't get it. When instantiating NIOFSDIrectory, how would I specify the path? I see only the empty constructor. With FSDirectory, you use the factory: getDirectory(File) -John On Thu, Dec 4, 2008 at 1:26 PM,

Re: NIOFSDirectory

2008-12-04 Thread Glen Newton
contention on FSDIrectory is gone, and for the set of queries >> we are running, performance improved by a factor of 5 (to be conservative). >> >>Great job, this is awesome, a simple change and made a huge difference. >> >>To get NIOFSDirectory installed, I di

Re: NIOFSDirectory

2008-12-04 Thread Yonik Seeley
vative). > >Great job, this is awesome, a simple change and made a huge difference. > >To get NIOFSDirectory installed, I didn't find any documentation > (doesn't mean there aren't any), after reading the code, I resorted to: > > static > {

NIOFSDirectory

2008-12-04 Thread John Wang
NIOFSDirectory installed, I didn't find any documentation (doesn't mean there aren't any), after reading the code, I resorted to: static { System.setProperty("org.apache.lucene.FSDirectory.class",NIOFSDirectory.class.getName()); } I am sure this is not the intended