groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: About caching Class instances and memory leak risk
Date Wed, 04 Apr 2018 10:43:18 GMT


Am 04.04.2018 um 05:39 schrieb Daniel Sun:
> Hi all,
> 
>       I find Groovy caches Class instances with strong reference[1][2], which
> will prevent Class instances unloading and may cause memory leak.
> 
>       Should we replace strong reference with soft reference? Any thoughts?
> 
> Cheers,
> Daniel.Sun
> 
> [1]
> https://github.com/apache/groovy/blob/master/src/main/groovy/groovy/lang/GroovyClassLoader.java#L93
> [2]
> https://github.com/apache/groovy/blob/master/src/main/groovy/groovy/lang/GroovyClassLoader.java#L99


every ClassLoader has a strong reference to the classes that ClassLoader 
defines. What we have to be careful of is not to keep references to 
other classes. Do you think this is violated?

bye Jochen

Mime
View raw message