lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Francl <luke.fra...@stellent.com>
Subject RE: IndexSearcher hanging on to old index files in Windows
Date Fri, 29 Apr 2005 19:46:50 GMT
On Fri, 2005-04-29 at 14:29, Monsur Hossain wrote:

> Thanks Chuck, this is all really helpful.  That explicit close() is what
> allows the files stored up in "deletable" to eventually be deleted.  I'm
> wary of relying on the GC to clean up my work, so I think I'll use that
> reference counting system you mentioned.  That way I can be guaranteed that
> at some point, my IndexSearcher is in fact closed.  (In my tests, when I
> left it up to the GC, these open file handles stuck around for hours).

I really recommend against relying on the GC to clean up operating
system resources. It's just not reliable, especially in long-running VMs
with lots of memory (like an application server). 

This can leave file handles open indefinitely, which can lead to
problems in Windows with too many open files, or deletion, as you've
seen.

I also implemented a reference counting scheme for IndexSearchers and it
works well.

Regards,
Luke Francl


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


Mime
View raw message