This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj-compiled jigsaw is running
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: gcj-compiled jigsaw is running
- From: Cedric Berger <cedric at wireless-networks dot com>
- Date: Wed, 02 May 2001 20:49:49 -0700
- CC: Per Bothner <per at bothner dot com>, java at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10105021437060.13023-100000@mars.deadcafe.org>
Jeff Sturm wrote:
> On 2 May 2001, Per Bothner wrote:
> > > Even if you get around that, there is no way to unload a compiled class,
> > > because the class instance isn't dynamically allocated and cannot be
> > > garbage collected.
> >
> > But shared libraries can be unloaded, I thought, so at least in
> > principle we coudl unload a compield class.
>
> Yes, in principle you can dlclose a class, if:
>
> 1) there are no live instances remaining
> 2) the class object and static fields are unreferenced
> 3) no thread is executing a static method
>
> I think it would be difficult to guarantee these conditions because the
> class object and static members are not heap objects. In theory a tracing
> collector could perhaps determine when there are no references anywhere to
> the text or data sections of a dynamic shared object, though I've never
> heard of such a thing... ordinarily GC is only concerned with reclaiming
> heap objects.
This can be worked around by allocating a small heap objects for each
class that points back to the static contents, right?
Of course that is another indirection... a compiler option, maybee?
Cedric