Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 19125 invoked from network); 18 Aug 2006 19:02:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Aug 2006 19:02:48 -0000 Received: (qmail 64749 invoked by uid 500); 18 Aug 2006 19:02:46 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 64607 invoked by uid 500); 18 Aug 2006 19:02:46 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 64596 invoked by uid 99); 18 Aug 2006 19:02:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2006 12:02:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [169.229.70.167] (HELO rescomp.berkeley.edu) (169.229.70.167) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2006 12:02:45 -0700 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 51E225B777; Fri, 18 Aug 2006 12:02:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id 4AF367F403 for ; Fri, 18 Aug 2006 12:02:25 -0700 (PDT) Date: Fri, 18 Aug 2006 12:02:25 -0700 (PDT) From: Chris Hostetter To: java-dev@lucene.apache.org Subject: Re: Custom sorting - memory leaks In-Reply-To: <3e8ef54f0608180201s185e6832w6ad5c50a88428dea@mail.gmail.com> Message-ID: References: <3e8ef54f0608180201s185e6832w6ad5c50a88428dea@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N : You can reproduce OutOfMemory easily. I've attach test files - this is : altered DistanceSortingTest example from LIA book. Also you can : profile it and see caching of distances arrays. An OutOfMemory error is differnet from a memory leak. Sorting with a custom Comparator does in fact use a lot of memory -- and if your Heap size is not big enough you may get an OutOfMemory -- but that doesn't mean you have a memory leak. A Memory leak is a problem where memory is allocated for objects, but not freed up once those objects are no longer of use -- just becuase you aren't using those objects, doesn't mean they aren't "of use" and it doesn't mean they won't be freed up once some futher action is taken (ie: closing of an IndexReader) Are you sure you've found an actual memory leak? ... ie: do you have a demonstratable test case that shows heap usage growing without bound over time? If so then seeing *that* code would be helpful to figure out if there is in fact a memory leak in Lucene, or if (perhaps) there is a mistaken assumption in your code (ie; not closing an IndexReader) -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org