Unloading classes

Anthony Green green@redhat.com
Sun Nov 3 18:40:00 GMT 2002


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /