You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Nuno Seco <ns...@dei.uc.pt> on 2009/01/02 18:53:14 UTC

Too many open files

Hello.

I'm struggling with the following exception:

Exception in thread "Lucene Merge Thread #1037" 
org.apache.lucene.index.MergePolicy$MergeException: 
java.io.FileNotFoundException: 
/home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many 
open files)
   at 
org.apache.lucene.index.ConcurrentMergeScheduler.handleMergeException(ConcurrentMergeScheduler.java:309) 

   at 
org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:286) 

Caused by: java.io.FileNotFoundException: 
/home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many 
open files)


I have only one indexwriter instantiated, and every time i update the 
index (add or remove a document), i commit the indexwriter and run the 
following code in order to make the searcher aware of the new documents:

private synchronized void refreshSearcher() throws 
CorruptIndexException, IOException
   {
       try
       {
           IndexReader reader = 
searcher.getIndexReader().reopen();                                  
searcher.close();
           searcher = new IndexSearcher(reader);

           if (reader != searcher.getIndexReader())
               searcher.getIndexReader().close();                       
       }
       catch (Exception e)
       {
           e.printStackTrace();
       }

   }


I have tried lowering the merge factor and the number of threads by 
executing the following:
((ConcurrentMergeScheduler)writer.getMergeScheduler()).setMaxThreadCount(1); 

writer.setMergeFactor(3);


I am using lucene 2.4.0 and there is only one thread manipulating the 
index.

any help would be appreciated.

Nuno Seco




---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Re: Too many open files

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Nuno,

Check towards the end of this article: http://www.onjava.com/pub/a/onjava/2003/03/05/lucene.html

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Nuno Seco <ns...@dei.uc.pt>
> To: java-dev@lucene.apache.org
> Sent: Friday, January 2, 2009 12:53:14 PM
> Subject: Too many open files
> 
> Hello.
> 
> I'm struggling with the following exception:
> 
> Exception in thread "Lucene Merge Thread #1037" 
> org.apache.lucene.index.MergePolicy$MergeException: 
> java.io.FileNotFoundException: 
> /home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many open 
> files)
>   at 
> org.apache.lucene.index.ConcurrentMergeScheduler.handleMergeException(ConcurrentMergeScheduler.java:309) 
> 
>   at 
> org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:286) 
> 
> Caused by: java.io.FileNotFoundException: 
> /home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many open 
> files)
> 
> 
> I have only one indexwriter instantiated, and every time i update the index (add 
> or remove a document), i commit the indexwriter and run the following code in 
> order to make the searcher aware of the new documents:
> 
> private synchronized void refreshSearcher() throws CorruptIndexException, 
> IOException
>   {
>       try
>       {
>           IndexReader reader = searcher.getIndexReader().reopen();              
>                     searcher.close();
>           searcher = new IndexSearcher(reader);
> 
>           if (reader != searcher.getIndexReader())
>               searcher.getIndexReader().close();                             }
>       catch (Exception e)
>       {
>           e.printStackTrace();
>       }
> 
>   }
> 
> 
> I have tried lowering the merge factor and the number of threads by executing 
> the following:
> ((ConcurrentMergeScheduler)writer.getMergeScheduler()).setMaxThreadCount(1); 
> writer.setMergeFactor(3);
> 
> 
> I am using lucene 2.4.0 and there is only one thread manipulating the index.
> 
> any help would be appreciated.
> 
> Nuno Seco
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org


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


Re: Too many open files

Posted by Nuno Seco <ns...@dei.uc.pt>.
I have just noticed that I subscribed the wrong list. I meant to 
subscribe and email the Java User List.

Sorry

Nuno Seco wrote:
> Hello.
>
> I'm struggling with the following exception:
>
> Exception in thread "Lucene Merge Thread #1037" 
> org.apache.lucene.index.MergePolicy$MergeException: 
> java.io.FileNotFoundException: 
> /home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many 
> open files)
>   at 
> org.apache.lucene.index.ConcurrentMergeScheduler.handleMergeException(ConcurrentMergeScheduler.java:309) 
>
>   at 
> org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:286) 
>
> Caused by: java.io.FileNotFoundException: 
> /home/plopes/aktwise/server-commons/data/lucenedata/_80c.tii (Too many 
> open files)
>
>
> I have only one indexwriter instantiated, and every time i update the 
> index (add or remove a document), i commit the indexwriter and run the 
> following code in order to make the searcher aware of the new documents:
>
> private synchronized void refreshSearcher() throws 
> CorruptIndexException, IOException
>   {
>       try
>       {
>           IndexReader reader = 
> searcher.getIndexReader().reopen();                                  
> searcher.close();
>           searcher = new IndexSearcher(reader);
>
>           if (reader != searcher.getIndexReader())
>               searcher.getIndexReader().close();                       
>       }
>       catch (Exception e)
>       {
>           e.printStackTrace();
>       }
>
>   }
>
>
> I have tried lowering the merge factor and the number of threads by 
> executing the following:
> ((ConcurrentMergeScheduler)writer.getMergeScheduler()).setMaxThreadCount(1); 
>
> writer.setMergeFactor(3);
>
>
> I am using lucene 2.4.0 and there is only one thread manipulating the 
> index.
>
> any help would be appreciated.
>
> Nuno Seco
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org