lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lamprecht <>
Subject Re: running out of file handles
Date Fri, 15 Apr 2005 04:21:45 GMT
Hi Guillermo,

Are you opening a new IndexSearcher when you see a new index version
(using IndexReader.getCurrentVersion())?  If so, you may need to
explicitly call close() on your IndexSearcher before opening a new

Also note that IndexSearcher has 3 constructors.  Two of them
automatically close the underlying IndexReader, but one does not.  So
if you're calling the IndexSearcher constructor that takes an
IndexReader parameter, you also need to close the IndexReader

If this doesn't help, can you post your code for us?  


On 4/14/05, Guillermo Payet <> wrote:
> Hi,
> We have one instance of IndexSearcher that's used for our entire
> web application. It's instantiated from a bean that's instantiated
> with a scope="application" useBean tag in Tomcat. This bean uses
> "static IndexSearcher is" to define the Index Searcher.
> In any case...  the point being that we want to just have one
> IndexSearcher for the whole App.
> But..  were starting to run out of file handles on our server,
> and an lsof returns lots and lots of these:
>  java 22755 tomcat 320r REG 9,3 2992899 1177377 /var/ix/_2a8.cfs (deleted)
>  java 22755 tomcat 321r REG 9,3 2994664 1177378 /var/ix/_2aa.cfs
> They accumulate until we end up with thousands of them, which breaks
> the whole thing.
> Now, I've verified that there really is only one instance of
> IndexSearcher which is being instantiated only once.  But...   Why is
> it opening the index file many times?  Should it load the index into
> memory only once?
> Is this "working as designed"?  Are we doing something wrong?
> BTW:  We get about 46,000 daily page views.  About 10% of those
> are for Lucene searches.
> Any clues?  Should I post our code here??
> Thanks!
>  --G
> --
> Guillermo Payet
> L O C A L  H A R V E S T
> Every Morning I awake torn between a desire to save the world and
> an inclination to savor it.  This makes it hard to plan the day.
>                                                       -E.B.White
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message