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

OutOfMemoryError with groovy.use.classvalue=false

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.11
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The following script causes an OOME.

      def classLoader = new groovy.lang.GroovyClassLoader()
      
      while(true){
        def clazz = classLoader.parseClass(' ')
        org.codehaus.groovy.runtime.InvokerHelper.removeClass(clazz)
      }
      

      If I run the script with -Dgroovy.use.classvalue, the OOME does not occur.
      The heap dump shows a lot of HashMap entries, most of them related to GroovyClassLoader's classCache.

      this     - value: java.util.HashMap$Node[] #361
       <- table     - class: java.util.HashMap, value: java.util.HashMap$Node[] #361
        <- permsMap     - class: java.security.Permissions, value: java.util.HashMap #858
         <- permissions     - class: java.security.ProtectionDomain, value: java.security.Permissions #103
          <- value     - class: java.util.HashMap$Node, value: java.security.ProtectionDomain #231
           <- [8]     - class: java.util.HashMap$Node[], value: java.util.HashMap$Node #751
            <- table     - class: java.util.HashMap, value: java.util.HashMap$Node[] #362
             <- pdcache     - class: groovy.lang.GroovyClassLoader$InnerLoader, value: java.util.HashMap #854
              <- <classLoader>     - class: script149484505219332, value: groovy.lang.GroovyClassLoader$InnerLoader #100
               <- value     - class: java.util.HashMap$Node, value: script149484505219332 class script149484505219332
                <- [2709]     - class: java.util.HashMap$Node[], value: java.util.HashMap$Node #753
                 <- table     - class: java.util.HashMap, value: java.util.HashMap$Node[] #11647
                  <- classCache (Java frame)     - class: groovy.lang.GroovyClassLoader, value: java.util.HashMap #5463
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jkemnade Jochen Kemnade
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: