I ran a simple test that creates a ClassLoader, executes some MXBean code using the ClassLoader, then waits for the ClassLoader to be garbage-collected. The ClassLoader is *not* garbage-collected, because of two problems:
(1) The class com.sun.jmx.mbeanserver.MXBeanLookup keeps a WeakHashMap<MBeanServerConnection, MXBeanLookup> in order to find the lookup table for a given MBeanServerConnection. Since MXBeanLookup has a reference to its MBeanServerConnection, entries in this WeakHashMap never go away. This means that if you create a number of connections to remote MBeanServers over the lifetime of an application, and you use those connections to navigate MXBean references, then you will build up entries in the WeakHashMap.
(2) The class javax.management.MBeanServerInvocationHandler keeps a WeakHashMap<Class<?>, MXBeanProxy> in order to avoid having to reapply the introspection logic on an MXBean interface every time that interface is used to make a proxy. Since MXBeanProxy has a field Map<Method, Handler> and the Methods in question come from the Class<?> that is a key in the WeakHashMap, again we have the classic bug where the values in a WeakHashMap strongly-reference the keys. This means that if you run some code from a ClassLoader that creates proxies using interfaces defined by that ClassLoader, then the ClassLoader will never be gc'd.