Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-167

XSLT transformation could throw an OutOfMemory exception with very large (> 10MB) requests

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1-QA-B3
    • Fix Version/s: 1.1-RC1
    • Component/s: Extension Mediators
    • Labels:
      None

      Description

      XSLT transformation of very large requests could throw the system OutOfMemory

        Activity

        Hide
        asankha Asankha C. Perera added a comment -

        After a few days of debugging and profiling I managed to find that the culprit was Xalan!
        (See here as well http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434840)

        Thus I have updated the XSLT mediator to use in-memory ByteArray streams for transformations upto 8K messages (transform source or result size) and to use temporary files where this size is exceeded. This allows me to perform transformations that yield both XML and non-XML outputs of over 10MB in size without any problem (even larger transformations should work fine now). The fix also removed the previously hard coded System property "javax.xml.transform.TransformerFactory" which may now be left unspecified (i.e. use the JDK default) or set to what you desire (e.g. "org.apache.xalan.xsltc.trax.TransformerFactoryImpl") depending on the environment/JDK used. This fix is checked in with associated unit tests

        Show
        asankha Asankha C. Perera added a comment - After a few days of debugging and profiling I managed to find that the culprit was Xalan! (See here as well http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434840 ) Thus I have updated the XSLT mediator to use in-memory ByteArray streams for transformations upto 8K messages (transform source or result size) and to use temporary files where this size is exceeded. This allows me to perform transformations that yield both XML and non-XML outputs of over 10MB in size without any problem (even larger transformations should work fine now). The fix also removed the previously hard coded System property "javax.xml.transform.TransformerFactory" which may now be left unspecified (i.e. use the JDK default) or set to what you desire (e.g. "org.apache.xalan.xsltc.trax.TransformerFactoryImpl") depending on the environment/JDK used. This fix is checked in with associated unit tests

          People

          • Assignee:
            asankha Asankha C. Perera
            Reporter:
            asankha Asankha C. Perera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development