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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]