This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj-compiled jigsaw is running
- To: Per Bothner <per at bothner dot com>
- Subject: Re: gcj-compiled jigsaw is running
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Wed, 2 May 2001 15:20:46 -0400 (EDT)
- cc: java at gcc dot gnu dot org
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.
Jeff