Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2178

Possible memory leak in XMLReaderManager

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.7, 2.6
    • None
    • transformation
    • None
    • PatchAvailable

    Description

      The XMLReaderManager caches the used XMLReader in a thread local variable. In multi tasking environments this is a possible memory leak, as the XMLReader (and everything referenced by this component) is still referenced after the process is finished - until another request uses the same thread.
      In our case this is causing out of memory exceptions.
      I don't know what the correct path to this problem is. For now, we removed the thread locals in the XMLReaderManager completly and created a new reader each time - which has a minor performance downside, but our application is still running
      I think one possible solution would be to clean up the reader when the transformation is finished - if this is possible.
      Another solution would be to make this configurable using a property?

      Attachments

        1. xalan-j2-2.6.0-xmlmemoryleak-tm2l.patch
          0.8 kB
          Michel Loiseleur
        2. XMLReaderManager.java
          4 kB
          Carsten Ziegeler

        Activity

          People

            Unassigned Unassigned
            cziegeler Carsten Ziegeler
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: