lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: AW: Problem with long run IndexSearcher
Date Mon, 19 May 2003 16:34:31 GMT
Karsten Konrad wrote:
> I think the whole appproach could be much simpler if every reader would simply
> close itself within its finalized method, but nevertheless it works this way quite
> well. In contrast to this, generating the presentation for the hit results in
> advance or redoing searches is more expensive. 

There is in effect a finalizer for IndexReader.  Input and output 
streams produced by an FSDirectory have finalizers that close the 
underlying file.  However finalizers are not always a satisfactory 
solution, as the delay between the object becoming unreachable and the 
finalizer being run can be considerable.  For example, with a 
generational garbage collector, a file held open for a long time will 
end up in a space that may only be collected every hour or so.  This is 
usually only a problem with unoptimized indexes with lots of fields, 
i.e., those which require lots of open files.  If your index is 
optimized and/or only contains a handful of fields, and doesn't change 
too frequently, then relying on finalization shouldn't be a problem.

Doug


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


Mime
View raw message