This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcj-compiled jigsaw is running



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]