lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ganyo <scott.ga...@eTapestry.com>
Subject RE: CachedSearcher
Date Tue, 16 Jul 2002 17:23:06 GMT
Point taken.  Indeed, these were general recommendations that may/may not
have a strong impact on Lucene's specific use of finalization.  My only
specific performance claim is that there will be a negative impact of some
degree using finalizers.  Whether that impact is noticable or not will
probably depend upon a number of factors.  So I will avoid making any
further judgements on the impact of finalization in Lucene on the
performance until I have proof.

Benchmarks aside, my point on the file handles is something that hit us
square between the eyes.  Before we started caching and explicitly closing
our Searchers we would regularly run out of file handles because of Lucene.
This was despite increasing our allocated file handles to ludicrous levels
in the OS.  I would recommend that, in general, Java developers would be
well advised to explicitly release external resources when done with them
rather than allowing finalization to take care of it.

Scott

> -----Original Message-----
> From: Doug Cutting [mailto:cutting@lucene.com]
> Sent: Tuesday, July 16, 2002 11:56 AM
> To: Lucene Users List
> Subject: Re: CachedSearcher
> 
> 
> Scott Ganyo wrote:
> > I'd like to see the finalize() methods removed from Lucene 
> entirely.  In a
> > system with heavy load and lots of gc, using finalize() 
> causes problems.
>  > [ ... ]
>  > External resources (i.e. file handles) are not released 
> until the reader
> > is closed.  And, as many have found, Lucene eats file 
> handles for breakfast,
> > lunch, and dinner.
> 
> Lucene does open and close lots of files relative to many 
> other applications, 
> but the number of files opened is still many orders of 
> magnitude less than the 
> number of other objects allocated.  I would be very surprised 
> if finalizers for 
> the hundreds of files that Lucene might open in a session 
> would have any 
> measurable impact on garbage collector performance given the 
> millions of other 
> objects that the garbage collector might process in that session.
> 
> As usual, one should not make performance claims without 
> performing benchmarks. 
>   It would be a simple matter to comment out the finalize() 
> methods, recompile 
> and compare indexing and search speed.  If the improvement is 
> significant, then 
> we can consider removing finalize methods.
> 
> Doug
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message