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

Memory leak with expando metaclass in groovy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.4, 2.4.9
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      Grails 2.5.1 (with updated Groovy version)
      Win 7
      Java HotSpot 64 v1.8.0_66-b17

      Description

      I am seeing a memory leak in my Grails app, which uses a lot of expando metaclass properties.

      From looking at the GC path, I believe this leak comes from the Groovy framework. I have attached a screenshot from jvisualvm which shows a path to the GC root. The path doesn't appear to contain any weak/soft reference types.

      Please let me know if you think my analysis is mistaken. I don't have a strong understanding of Groovy framework internals.

      GC via JMX does not remove these objects.

      Updating my BuildConfig to use Groovy 2.4.9 (with forked compile) did not fix the issue.

      (Note: Some of the dependencies in the attached BuildConfig are proprietary and not available from the grails plugin repo.)

        Attachments

        1. BuildConfig.groovy
          4 kB
          Russell Morrisey
        2. groovy mem leak.png
          46 kB
          Russell Morrisey

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rmorrise Russell Morrisey
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: