This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Unloading classes
On Sun, 2002-11-03 at 18:05, Jeff Sturm wrote:
> It's the simplest way to satisfy the condition that a class cannot be
> unloaded while its classloader is reachable, as described in JLS 12.7:
Ok - thanks for the reference.
> > Another interesting question is how to handle System.loadLibrary(). Can
> > we dlclose() them when the class calling System.loadLibrary is
> > finalized?
>
> I think you need to guarantee no static method of the class is executing
> when you dlclose(). This is hard with the current GC.
Hmm... I don't really follow this. How could a class being finalized
have any methods executing?
I guess if classes don't get finalized until their loader is finalized,
we could have the class loader keep track of libraries loaded via
System.loadLibrary, kind of like the SharedLibLoader.
AG