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

Memory leak in case of concurrent access to Templates object

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

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.6
    • None
    • transformation
    • None
    • JBoss 3.2.6 AS, JDK 1.4.2, Windows 2000

    Description

      I use Xalan/Xerces to perform FOP processing inside a J2EE application.
      I recently introduced the use of Templates object as a performance optimization.
      As the spec says Templates objects have to thread safe, I used it as static field from which I creates Transformer objects.
      Note that each thread receives its own Transformer object, so the use seems correct regarding threading issues.
      However I noticed thereafter a memory leak inside the AS in case of important load.
      Using a profiling tool, I saw TransformerImpl objects (and the associated object graph) filling up the memory.
      The root to the GC showed references from the static Templates field.

      I observed this phenomenon wih Xalan 2.4.1 but upgrading to version 2.6 did not help.

      The reference graph shows something like :
      StylesheetRoot (static) -> Vector[ElemTemplate] -> ... -> SAX2DTM -> TransformerImpl

      I can attach the full graph if needed.

      I saw related issues talking about Iterator objects keeping references and there are indeed Iterator objects involved in the reference graph.
      But in my case this shows up only in the case of an heavily threaded environment.

      Anyway, the result is an application server whose memory is filled up and unusable.

      Attachments

        1. graph_3.png
          130 kB
          Nicolas Bonmariage
        2. historicOperationsNotConsolidated.xsl
          15 kB
          Nicolas Bonmariage
        3. report.xml
          11 kB
          Nicolas Bonmariage
        4. report.xsl
          112 kB
          Nicolas Bonmariage

        Activity

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

          People

            Unassigned Unassigned
            bsbnbo Nicolas Bonmariage

            Dates

              Created:
              Updated:

              Slack

                Issue deployment