Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-556

PermGen Leak when using Atom providers

    Details

    • Steps to Reproduce:
      Hide

      Using the unit test attached, you should be able to reproduce. Basically, call writeTo method of AtomFeedProvider/AtomEntryProvider multiple times, watch number of classes loaded in JVM continue to rise.

      Show
      Using the unit test attached, you should be able to reproduce. Basically, call writeTo method of AtomFeedProvider/AtomEntryProvider multiple times, watch number of classes loaded in JVM continue to rise.

      Description

      While performing load tests on a new system using RestEASY to provide atom feed representations, I discovered that the PermGen space was continually rising; I tracked this issue down to the AtomEntryProvider and AtomFeedProvider classes. From other things I've seen on the internet, it appears that the JAXB implementors intend for JAXBContext objects to be reused (e.g. see http://java.net/jira/browse/JAXB-581).

      I'm attaching a patch with both a unit test and a fix for the two classes, switching them from using createContext to findCacheContext. Given the above issue, it may also be worthwhile to consider redesigning the JAXBContextFinder interface so that createContext is not exposed.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bill.burke Bill Burke
                Reporter:
                lawrie00 James Lawrie
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: