There's no support for class unloading, mainly because we dump all static data into the JTOC and trying to separate wheat and chaff here would be very awkward. We really need to restructure the static data, the root of all statics should be the JTOC but then hanging off of this should be the class loaders, then hanging off the class loaders the classes, and in each class the statics. TIBs and other constant like things need hanging where appropriate. We can then possibly use weak references to unload things when they are no longer accessed.
The trackers for these things are:
[ 1571462 ] replace JTOC with per-classloader static segments
[ 1571374 ] Type dictionaries should be per-classloader, not global
I think writing weak references is something the boot image writer doesn't do particularly gracefully (I believe it just writes nulls), so there's quite a bit of work to bring about this restructure. It'd be very nice to have, but if we're going to restructure we'd probably also better think how JMX can integrate with a weak reference model. Using finalizers could be an expensive solution.