lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Loucks" <>
Subject RE: IndexSearcher hanging on to old index files in Windows
Date Fri, 29 Apr 2005 20:19:43 GMT
I had this exact same problem in a j2ee + windows environment. Even when
the index searcher was closed, it still seemed to hold onto the file. As
I recall I solved this by only caching the IndexSearcher long enough to
get the results I wanted to display. If the user would look at the next
page of results the query would be run again. This didn't affect

Aaron Loucks
Web Developer
Gardner, Inc.
3641 Interchange Road 
Columbus, OH 43204 
-----Original Message-----
From: Monsur Hossain [] 
Sent: Thursday, April 28, 2005 6:11 PM
Subject: IndexSearcher hanging on to old index files in Windows

Hi all.  I'm running Lucene.NET in a Windows/ASP.NET environment.  We
searching a 300meg index in a web environment, where the IndexSearcher
cached.  Every 10-30 minutes, a separate process updates the index.
ASP.NET's cache detects a changed index, it drops the current
(which the Garbage collector takes care of in the future [1]) and
creates a
new one. 

Now, while the index is being updated, the current IndexSearcher in
holds a reference to the old index files.  Therefore, the IndexWriter
delete them, and they sit around in the folder, continuing to grow.
the IndexSearcher is left to the GC, there's no guarantee of when the
will be released.  

I was considering such previously mentioned systems as reference
[2] and swapping between two indexes [3].  But in both these cases, I
think I'm ever guaranteed that an old IndexSearcher will have released
grasp on the old files in time to delete them.  

Anyway, I'd like to hear if others are dealing with this issue.

Also, I'm curious, is this a Windows specific issue; I haven't seen any
mention of this on UNIX?


[3] I can't find a link to it, but it was suggested by George Aroush in
previous thread of mine.

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

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

View raw message