Re: class gc (fwd)

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Thu Dec 17 1998 - 16:56:42 EST


>
> > Since we keep the entries in the class pool until the loader is finalized
>
> Does this mean finalizer() or quasi-finalizer-like finalization?

This means quasi-finalizer: I mean finalizeClassLoader in classMethod.c,
specifically.

>
> > static initializer won't ever be run twice because the VM won't ask
> > the classloader to load/define a class. If the loader attempts it
> > itself, it will see duplicate definition cause the entry pool is
> > consulted.
>
> Are you telling me that a Class won't be unloaded until its
> ClassLoader is finalized? If this is the case, it's correct.

Yes. At least, I think so.

I may be wrong, though.

Actually, I think I'm probably wrong: if there's no object of that
class, and the class loader doesn't hold a reference, the class will
be gc'd.

Then loadClass() will give a duplicate name error, but the class
object you get through findLoadedClass is bogus.

So I think you're right, we need a connection from the classloader
to the class that is walked.

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:21 EDT