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

Groovy categories cause tomcat memory leak and prevent tomcat shutting down

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

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.7.2
    • 1.8.0
    • groovy-runtime
    • None

    Description

      Any Groovy application (including Grails apps) that deploy to Tomcat 6.0.26 and above has this issue because basically Tomcat clears thread locals not manually shutdown by the application to prevent memory leaks.

      This can lead to problems starting and stopping Groovy based application with errors like the following occuring:

          [java] Exception in thread "Thread-3" java.lang.NullPointerException
           [java] 	at org.codehaus.groovy.runtime.GroovyCategorySupport.hasCategoryInCurrentThread(GroovyCategorySupport.java:216)
           [java] 	at groovy.lang.MetaClassImpl.getMethodWithCaching(MetaClassImpl.java:1128)
           [java] 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:904)
           [java] 	at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:915)
           [java] 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
           [java] 	at groovy.lang.Closure.call(Closure.java:276)
           [java] 	at groovy.lang.Closure.call(Closure.java:271)
           [java] 	at groovy.lang.Closure.run(Closure.java:354)
      

      Groovy needs to include the ability to manually shutdown the any categories that exist in any threads and also re-instate the categories if they are nulled (like what happens with Tomcat)

      Attachments

        Issue Links

        Activity

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

          People

            jwagenleitner John Wagenleitner
            graemerocher Graeme Rocher
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment