Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
2.3.6, 2.4.1
-
None
Description
The following will quite quickly result in a java.lang.OutOfMemoryError: PermGen space:
while(true) { new ConfigSlurper().parse("") }
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:
while (true) { new ConfigSlurper() { ConfigObject parse(Script script, URL location) { def config = super.parse(script, location) GroovySystem.metaClassRegistry.removeMetaClass(script.class) config } }.parse("") }