Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 98055 invoked from network); 7 Dec 2006 15:01:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 15:01:07 -0000 Received: (qmail 35929 invoked by uid 500); 7 Dec 2006 15:01:12 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 35899 invoked by uid 500); 7 Dec 2006 15:01:12 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 35889 invoked by uid 99); 7 Dec 2006 15:01:12 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 07:01:12 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gcjhd-harmony-dev@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 07:01:00 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GsKjZ-0003E9-DD for dev@harmony.apache.org; Thu, 07 Dec 2006 16:00:25 +0100 Received: from msfwpr01.ims.intel.com ([62.118.80.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Dec 2006 16:00:25 +0100 Received: from Salikh.Zakirov by msfwpr01.ims.intel.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Dec 2006 16:00:25 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: dev@harmony.apache.org From: Salikh Zakirov Subject: Re: [classlib][swing][testing] Tests that depend on Garbage Collector Date: Thu, 07 Dec 2006 18:00:16 +0300 Lines: 20 Message-ID: References: <8E389A5F2FEABA4CB1DEC35A25CB39CE82FB84@mssmsx411> <457780CE.1050006@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: msfwpr01.ims.intel.com User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <457780CE.1050006@gmail.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Richard wrote: > According to the spec, "System.gc" only suggests JVM recycle unused > objects, it does not guarantee that gc will be run. Indeed, spec does not guarantee that garbage collection will be started, however it strongly suggests to do so ... When control returns from the method call [System.gc()], the Java Virtual Machine has made a best effort to reclaim space from all discarded objects. Since a number of tests explicitly assume that System.gc() will detect objects eligible for finalization and reset weak reference, it would be very inconvenient to break that expectation. DRLVM gc_cc (current default garbage collector) does a special type of garbage collection on System.gc(), with a special purpose of identifying finalizable objects and resetting weak references. As far as I saw from -verbose:gc logs, JRockit and Hotspot do a full garbage collection on System.gc(), so the assumption holds too.