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

GStringTemplateEngine leaks classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.6
    • 2.3.8
    • Templating
    • None
    • Patch

    Description

      I discovered this issue while working on https://jira.grails.org/browse/GRAILS-11296

      Each time GStringTemplateEngine compiles a template, it makes a new class. However, it makes all those new classes on the main (parent) class loader. Since that class loader has loaded many other classes that won't ever get GC'ed, and a class can only be GC'ed when it's class loader is GC'ed and vice versa, these GStringTemplateEngine created classes can never be GC'ed. With enough invocations, memory is exhausted. These classes show up in memory dumps as "GStringTemplateScript" followed by a number.

      Attachments

        Activity

          People

            melix Cédric Champeau
            candrews Craig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: