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

GroovyClassLoader.parseClass(File) Not Closing Streams

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-10
    • 1.0-JSR-4
    • class generator
    • None
    • groovy-1.0-beta 10 on Linux

    Description

      It appears that generating a class using GroovyClassLoader.parseClass(File) has the side effect of opening a stream on that file that is never closed. The result of this under load can be an exception (Too Many Files Open) on Linux - may affect other OSes.

      In contrast and as a workaround, creating a FileInputStream on the file, invoking GroovyClassLoader.parseClass(InputStream, String(File.getAbsolutePath())), and subsequently closing the stream does not appear to have any ill side effects.

      My test case was roughly 5 instances of an application which uses 95 generated classes per instance on SUSE 9.0.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            nyven Ron Lancaster
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: