groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain Stalder <astal...@span.ch>
Subject Re: Improve Groovy class loading performance and memory management
Date Tue, 17 May 2016 07:48:15 GMT

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

Mime
View raw message