1. A method, comprising: obtaining, via a processor, a classloader cache class definition that comprises code that creates a classloader object cache that is referenced via a strong internal reference by a classloader object in response to instantiation of the classloader cache class definition; instantiating the classloader object cache using the obtained classloader cache class definition, where the strong internal reference is created at instantiation of the classloader object cache; and providing a public interface to the classloader object cache that operates as a weak reference to the classloader object cache and that provides external access to the classloader object cache; where the strong internal reference comprises a static reference to the classloader object cache within an implementation class that implements the classloader object cache and the weak reference to the classloader object cache allows garbage collection of the classloader object cache to occur in response to the classloader object cache being unloaded.