I don't think the current design permits classes to be unloaded. There's a chain of strong references from the static singleton to the class in the cache, which should prevent the weak key from being effective.

Just switch it from a WeakHashMap to a LinkedHashMap and give up on unloading? Or move the cache to ObjectGraph and let that be the unit of unloading?

Note that extension graphs can share a cache with their parent graph, decreasing the cost of throwaway child graphs.