harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Archie Cobbs <arc...@dellroad.org>
Subject Re: [Arch] Class unloading and VM objects reclaim
Date Thu, 08 Sep 2005 02:52:02 GMT
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

Mime
View raw message