Quantcast

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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

JIRA jira@apache.org

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

John Wagenleitner commented on GROOVY-8189:
-------------------------------------------

One alternative may be {{GroovyClassLoader.clearCache()}} which cleans up the meta class/bean info caches and also clears the {{classCache}}.

> 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)
Loading...