groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-7083) PermGen memory leak in ConfigSlurper.parse(Script script, URL location)
Date Fri, 23 Mar 2018 01:26:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-7083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Sun resolved GROOVY-7083.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 2.6.0-alpha-4
                   2.5.0-rc-1
                   3.0.0-alpha-2

Fixed by: https://github.com/apache/groovy/commit/8cb3793498199d9fcff32484e5208f311f94cad4

> PermGen memory leak in ConfigSlurper.parse(Script script, URL location)
> -----------------------------------------------------------------------
>
>                 Key: GROOVY-7083
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7083
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 2.3.6, 2.4.1
>            Reporter: Marcin Erdmann
>            Assignee: Daniel Sun
>            Priority: Critical
>             Fix For: 3.0.0-alpha-2, 2.5.0-rc-1, 2.6.0-alpha-4
>
>
> The following will quite quickly result in a java.lang.OutOfMemoryError: PermGen space:
> {code}
> while(true) {
>     new ConfigSlurper().parse("")
> }
> {code}
> This is due to ConfigSlurper.parse(Script script, URL location) modifying meta class
of the compiled config script class and not clearing it afterwards which means that there
is reference to that class in meta class registry and it never gets garbage collected.
> The exception does not occur for the following:
> {code}
> while (true) {
>     new ConfigSlurper() {
>         ConfigObject parse(Script script, URL location) {
>             def config = super.parse(script, location)
>             GroovySystem.metaClassRegistry.removeMetaClass(script.class)
>             config
>         }
>     }.parse("")
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message