Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 49357 invoked from network); 16 Jul 2002 14:40:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 16 Jul 2002 14:40:38 -0000 Received: (qmail 5385 invoked by uid 97); 16 Jul 2002 14:40:51 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 5350 invoked by uid 97); 16 Jul 2002 14:40:50 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 5330 invoked by uid 98); 16 Jul 2002 14:40:50 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: From: Scott Ganyo To: 'Lucene Users List' Subject: RE: CachedSearcher Date: Tue, 16 Jul 2002 09:40:43 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C22CD6.C3446C60" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C22CD6.C3446C60 Content-Type: text/plain; charset="ISO-8859-2" Content-Transfer-Encoding: quoted-printable 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. To wit: 1) I was at a talk at JavaOne last year where the gc performance = experts from Sun (the engineers actually writing the HotSpot gc) were giving performance advice. They specifically stated that finalize() should be avoided if at all possible because the following steps have to happen = for finalized objects: a) register the object when created b) notice the object when it becomes unreachable c) finalize the object d) notice the object when it becomes unreachable (again) e) reclaim the object This leads to the following effects in the vm: a) allocation is slower b) heap is bigger c) gc pauses are longer The Sun engineers recommended that if you really do need an automatic = clean up process, that Weak references are *much* more efficient and should = be used in preference to finalize(). 2) 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. Scott > -----Original Message----- > From: Hal=E1csy P=E9ter [mailto:halacsy.peter@axelero.com] > Sent: Tuesday, July 16, 2002 12:43 AM > To: Lucene Users List > Subject: RE: CachedSearcher >=20 >=20 >=20 >=20 > > -----Original Message----- > > From: Doug Cutting [mailto:cutting@lucene.com] > > Sent: Tuesday, July 16, 2002 1:00 AM > > To: Lucene Users List > > Subject: Re: CachedSearcher > >=20 > >=20 > > Why is this more complicated than the code in demo/Search.jhtml=20 > > (included below)? FSDirectory closes files as they're GC'd, so you = > > don't have to explicitly close the IndexReaders or Searchers. >=20 > I'll check this code, but I think it could hang up with a lot=20 > of opened IndexReader. > http://developer.java.sun.com/developer/TechTips/2000/tt0124.html >=20 > (If a lot of searcher is requested ant a writer is always=20 > modificating the index).=20 >=20 > peter >=20 > -- > To unsubscribe, e-mail: =20 > > For additional commands, e-mail:=20 > >=20 ------_=_NextPart_001_01C22CD6.C3446C60--