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

OutOfMemoryError with groovy.use.classvalue=false

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.11
    • None
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            jkemnade Jochen Kemnade

            Dates

              Created:
              Updated:

              Slack

                Issue deployment