[
https://issues.apache.org/jira/browse/GROOVY-7083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004150#comment-16004150
]
Jochen Kemnade commented on GROOVY-7083:
----------------------------------------
I can reproduce this with 2.4.11.
> 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
>
> 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
(v6.3.15#6346)