gcj-compiled jigsaw is running

Cedric Berger cedric@wireless-networks.com
Wed May 2 20:47:00 GMT 2001


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




More information about the Java mailing list