I wrote: > Or is there maybe at least hope on the horizon for Java 9 or 10 ?
Appears to be, at least as far as garbage collection of class loaders and their classes is concerned. Yesterday a current preview of JDK 9 behaved much better with regards to collecting class loaders and their classes. First the number of classes was rising as I created class loaders and used them to load a class in a loop (and then kept no references), but after rising a bit, occupied MetaSpace became a straight line, as class loaders and their classes were continuously garbage collected from then on...
Maybe this can also be achieved with Java 8 and earlier by tweaking JVM parameters, but to me JDK 9 seems to be the first JVM where this works "out-of-the-box", which is crucial for many applications, I would say.
