classloading from so

Jeff Sturm jsturm@one-point.com
Tue Sep 24 15:51:00 GMT 2002


On Tue, 24 Sep 2002, Boehm, Hans wrote:
> > It appears if you use the SharedLibLoader, instead of the built-in
> > one, then you can get class unloading.  I have never tried it, but I
> > do note that SharedLibLoader.finalize() calls dlclose().  Of course,
> > for this to work, the SharedLibLoader and all its classes must be
> > collected.
>
> Hopefully the class loader is referenced from a static variable in the
> loaded library?

It isn't.  SharedLibLoader doesn't set the "loader" field at all on its
loaded classes.  I'm pretty sure this is a bug.  I'll file a PR.

> Thus this can never happen because the garbage
> collector views the library static data as roots and would thus never
> collect the class loader?

I suspect it could.

Jeff




More information about the Java mailing list