Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 67597 invoked from network); 8 Sep 2005 02:52:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2005 02:52:12 -0000 Received: (qmail 40750 invoked by uid 500); 8 Sep 2005 02:52:08 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 40695 invoked by uid 500); 8 Sep 2005 02:52:07 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 40680 invoked by uid 99); 8 Sep 2005 02:52:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2005 19:52:07 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: unknown (asf.osuosl.org: error in processing during lookup of archie@dellroad.org) Received: from [216.239.128.26] (HELO smtp.omnis.com) (216.239.128.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2005 19:52:19 -0700 Received: from [71.8.79.247] (71-8-79-247.dhcp.leds.al.charter.com [71.8.79.247]) by smtp-relay.omnis.com (Postfix) with ESMTP id 1639214077EA for ; Wed, 7 Sep 2005 19:52:04 -0700 (PDT) Message-ID: <431FA752.8030407@dellroad.org> Date: Wed, 07 Sep 2005 21:52:02 -0500 From: Archie Cobbs User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041129 X-Accept-Language: en-us, en MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [Arch] Class unloading and VM objects reclaim References: <9623c9a5050907194513922548@mail.gmail.com> In-Reply-To: <9623c9a5050907194513922548@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Xiao-Feng Li wrote: > They are basically two approaches to unload the classes, one is to > encode the VM object similarly as App object with a header, then GC > can treat them uniformly (almost); the other approach treats class > unloading specially, which reclaims a class loader together with all > its associated VM objects. The former approach can reclaim as more as > possible VM objects (besides other benefits such as code placement) > but requires more GC overhead, while the latter approach can reclaim a > class loader related objects all together if they are arranged > properly. You can get the benefits of both approaches using per-class loader memory areas like SableVM and JCVM. Each class loader has it's own stack of memory. All loader-related memory is allocated from that stack (including possibly java.lang.Class objects). Then when you unload the loader you free the entire stack at once. During GC you treat a class loader's stack as a single giant object. For more info: http://jcvm.sourceforge.net/share/jc/doc/jc.html#GC%20and%20Class%20Loaders Cheers, -Archie __________________________________________________________________________ Archie Cobbs * CTO, Awarix * http://www.awarix.com