Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7884

GroovyScriptEngineImpl usage of CompilerConfiguration can lead to memory leaks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.5
    • 2.4.8
    • None
    • None

    Description

      In the constructor of GroovyScriptEngineImpl the CompilerConfiguration is created each time, while it should use CompilerConfiguration.DEFAULT.

      This can lead to memory leaks in environments where there is an high usage of GroovyScriptEngineImpl because CompilerConfiguration creates a PrintWriter on System.err (i.e. under the hood it creates a BufferedWriter with a default buffer of 8192 elements) when setting the field "output".
      I have observed this behaviour using Apache Camel.
      I don't know if all the GroovyScriptEngineImpl instances are legit or are themselves a leak: I will investigate on this later and report to the Apache Camel team.

      Attachments

        Issue Links

          Activity

            People

              jwagenleitner John Wagenleitner
              rste79 Stefano Rocca
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: