JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-6285

Some transformers create execution contexts that are not cleared after execution

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.1.3 (EE only), 3.2.2 (EE only), 3.3.0
  • Fix Version/s: 3.1.4 (EE only), 3.2.3 (EE only), 3.3.1
  • Component/s: Core: Transformers
  • Labels:
    None
  • User impact:
    High
  • Configuration:
    Hide

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:file="http://www.mulesoft.org/schema/mule/file"
    xmlns:script="http://www.mulesoft.org/schema/mule/scripting"
    xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml"
    xsi:schemaLocation="
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
    http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd
    http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd
    http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd">
    <file:connector name="X" autoDelete="true" streaming="false"/>
    <flow name="FSBME012RUD-main">
    <file:inbound-endpoint path="/tmp/test" pollingFrequency="1000"/>
    <object-to-string-transformer/>
    <script:transformer>
    <script:script engine="groovy">
    <script:text>
    operatorRecordIds = [:]
    operatorRecordCounts = [:]
    message.setSessionProperty("operatorRecordIds", operatorRecordIds)
    message.setSessionProperty("operatorRecordCounts", operatorRecordCounts)
    return payload
    </script:text>
    </script:script>
    </script:transformer>
    <mulexml:xslt-transformer name="xslt">
    <mulexml:xslt-text>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
    <xsl:param name="title"/>
    <xsl:param name="rating"/>
    <xsl:param name="payload"/>
    <xsl:template match="catalog">
    <xsl:element name="cd-listings">
    <xsl:attribute name="title">
    <xsl:value-of select="$title"/>
    </xsl:attribute>
    <xsl:attribute name="rating">
    <xsl:value-of select="$rating"/>
    </xsl:attribute>
    <xsl:value-of select="$payload"/>
    <xsl:apply-templates/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="cd">
    <xsl:element name="cd-title">
    <xsl:value-of select="title"/>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    </mulexml:xslt-text>
    <mulexml:context-property key="title" value="#[string:foo]"/>
    <mulexml:context-property key="rating" value="#[string:bar]"/>
    <mulexml:context-property key="payload" value="#[payload]"/>
    </mulexml:xslt-transformer>

    <file:outbound-endpoint path="/tmp/out"/>
    </flow>
    </mule>

    Show
    <?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:script="http://www.mulesoft.org/schema/mule/scripting" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.1/mule-file.xsd http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.1/mule-xml.xsd http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd"> <file:connector name="X" autoDelete="true" streaming="false"/> <flow name="FSBME012RUD-main"> <file:inbound-endpoint path="/tmp/test" pollingFrequency="1000"/> <object-to-string-transformer/> <script:transformer> <script:script engine="groovy"> <script:text> operatorRecordIds = [:] operatorRecordCounts = [:] message.setSessionProperty("operatorRecordIds", operatorRecordIds) message.setSessionProperty("operatorRecordCounts", operatorRecordCounts) return payload </script:text> </script:script> </script:transformer> <mulexml:xslt-transformer name="xslt"> <mulexml:xslt-text> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:param name="title"/> <xsl:param name="rating"/> <xsl:param name="payload"/> <xsl:template match="catalog"> <xsl:element name="cd-listings"> <xsl:attribute name="title"> <xsl:value-of select="$title"/> </xsl:attribute> <xsl:attribute name="rating"> <xsl:value-of select="$rating"/> </xsl:attribute> <xsl:value-of select="$payload"/> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="cd"> <xsl:element name="cd-title"> <xsl:value-of select="title"/> </xsl:element> </xsl:template> </xsl:stylesheet> </mulexml:xslt-text> <mulexml:context-property key="title" value="#[string:foo]"/> <mulexml:context-property key="rating" value="#[string:bar]"/> <mulexml:context-property key="payload" value="#[payload]"/> </mulexml:xslt-transformer> <file:outbound-endpoint path="/tmp/out"/> </flow> </mule>
  • Similar Issues:
    None

Description

Some transformers (xslt and scripting being two of them) create execution contexts. These contexts are not cleared after the execution of the transformer, so information is kept in memory until the next message arrives.
Customers with a large number of transformers and large messages report that Mule creates objects that are never garbage collected after a message has been processed.
Steps to reproduce:
1) Run the attached configuration.
2) Connect a profiler
3) Copy the attached XML file in the "/tmp/test" folder
4) Force a garbage collection
5) Look for the retained size of GroovyScriptEngineImpl and XsltTransformer
(both objects still retain the message that has passed through)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    test-1.xml.zip
    07/Jun/12 03:35 PM
    246 kB
    Pablo Kraan
    1. XML File
      test.xml 10.84 MB
    2. XML File
      ._test.xml 0.1 kB
    Download Zip
    Show
    Zip Archive
    test-1.xml.zip
    07/Jun/12 03:35 PM
    246 kB
    Pablo Kraan

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Pablo Kraan added a comment - 07/Jun/12 04:34 PM

Fix 3.1.x
http://fisheye.codehaus.org/changelog/mule/?cs=24525

Fix 3.2.x
http://fisheye.codehaus.org/changelog/mule/?cs=24526

Fix 3.3.x
http://fisheye.codehaus.org/changelog/mule/?cs=24527

Fix 3.x
http://fisheye.codehaus.org/changelog/mule/?cs=24528

Show
Pablo Kraan added a comment - 07/Jun/12 04:34 PM Fix 3.1.x http://fisheye.codehaus.org/changelog/mule/?cs=24525 Fix 3.2.x http://fisheye.codehaus.org/changelog/mule/?cs=24526 Fix 3.3.x http://fisheye.codehaus.org/changelog/mule/?cs=24527 Fix 3.x http://fisheye.codehaus.org/changelog/mule/?cs=24528

People

  • Assignee:
    Alejandro Sequeira
    Reporter:
    Pablo Kraan
Vote (0)
Watch (0)

Dates

  • Created:
    07/Jun/12 03:35 PM
    Updated:
    13/Jun/12 03:03 PM
    Resolved:
    13/Jun/12 03:03 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.