On 17.05.16 09:04, Alain Stalder wrote:
PS: Note that Introspector.flushFromCaches(clazz) was experimentally
really not necessary in this case, but maybe has to do with the simple
nature of the test script ("42") and only calling a (no-args)
constructor... In any case very promising...
Ah, that's simply because it is already called in
InvokerHelper.removeClass():
public static void removeClass(Class clazz) {
metaRegistry.removeMetaClass(clazz);
ClassInfo.remove(clazz);
Introspector.flushFromCaches(clazz);
}
Experimentally, for the test with ClassGCTester, the first call
(metaRegistry.removeMetaClass(clazz)) was not necessary to have garbage
collection before Metaspace reaches the maximum, the other two were.
Alain