You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2017/05/15 11:15:04 UTC

[jira] [Commented] (GROOVY-8189) OutOfMemoryError with groovy.use.classvalue=false

    [ https://issues.apache.org/jira/browse/GROOVY-8189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16010332#comment-16010332 ] 

Jochen Kemnade commented on GROOVY-8189:
----------------------------------------

bq. If I run the script with -Dgroovy.use.classvalue, the OOME does not occur.
No, I was wrong, it just runs longer before the error occurs.
If I add {{clazz.classLoader.removeClassCacheEntry(clazz.name)}} to the loop, the situation improves. Should {{InvokerHelper.removeClass(clazz)}} do that?

> OutOfMemoryError with groovy.use.classvalue=false
> -------------------------------------------------
>
>                 Key: GROOVY-8189
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8189
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.11
>            Reporter: Jochen Kemnade
>
> The following script causes an OOME.
> {code}
> def classLoader = new groovy.lang.GroovyClassLoader()
> while(true){
>   def clazz = classLoader.parseClass(' ')
>   org.codehaus.groovy.runtime.InvokerHelper.removeClass(clazz)
> }
> {code}
> If I run the script with {{-Dgroovy.use.classvalue}}, the OOME does not occur.
> The heap dump shows a lot of {{HashMap}} entries, most of them related to {{GroovyClassLoader}}'s {{classCache}}.
> {noformat}
> this     - value: java.util.HashMap$Node[] #361
>  <- table     - class: java.util.HashMap, value: java.util.HashMap$Node[] #361
>   <- permsMap     - class: java.security.Permissions, value: java.util.HashMap #858
>    <- permissions     - class: java.security.ProtectionDomain, value: java.security.Permissions #103
>     <- value     - class: java.util.HashMap$Node, value: java.security.ProtectionDomain #231
>      <- [8]     - class: java.util.HashMap$Node[], value: java.util.HashMap$Node #751
>       <- table     - class: java.util.HashMap, value: java.util.HashMap$Node[] #362
>        <- pdcache     - class: groovy.lang.GroovyClassLoader$InnerLoader, value: java.util.HashMap #854
>         <- <classLoader>     - class: script149484505219332, value: groovy.lang.GroovyClassLoader$InnerLoader #100
>          <- value     - class: java.util.HashMap$Node, value: script149484505219332 class script149484505219332
>           <- [2709]     - class: java.util.HashMap$Node[], value: java.util.HashMap$Node #753
>            <- table     - class: java.util.HashMap, value: java.util.HashMap$Node[] #11647
>             <- classCache (Java frame)     - class: groovy.lang.GroovyClassLoader, value: java.util.HashMap #5463
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)