Microsoft Knowledge Base Email Alertz

After you add an

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 293080 - Last Review: October 16, 2002 - Revision: 1.4

FIX: Memory Leak on addParameter with Cached XSL Template at ASP Application Level

This article was previously published under Q293080

On This Page

SYMPTOMS

After you add an XMLDOMDocument or XMLDOMNode object to an Extensible Stylesheet Language (XSL) template that is cached in an Active Server Pages (ASP) Application variable, and you set an XSLProcessor object in a second ASP page to use the cached Application level template as a parameter, the XSLProcessor object's transform method consumes a large amount of memory.

You only see memory usage grow if the XSL template is cached at the ASP Application level. You do not see the memory leak if you create a new XSL template every time that the XSLProcessor object is used.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Microsoft XML 3.0 Service Pack 1.

For additional information on other fixes included in Microsoft XML 3.0 Service Pack 1, click the article number below to view the article in the Microsoft Knowledge Base:
292935  (http://kbalertz.com/Feedback.aspx?kbNumber=292935/EN-US/ ) INFO: List of Issues Fixed in Microsoft XML 3.0 Service Pack 1
For the latest information and downloads of MSXML, refer to the following MSDN Web site at:
http://msdn.microsoft.com/xml/default.asp (http://msdn.microsoft.com/xml/default.asp)

MORE INFORMATION

Steps to Reproduce Behavior

  1. Save the following code as File1.asp:
    <%
    '=============================================
    ' File1.asp - Run once to cache the template
    ' in an Application object.
    
    Dim oXSLDocument
    Set oXSLDocument = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
    oXSLDocument.async = False
    oXSLDocument.load(Server.MapPath("test.xsl"))
    
    Dim oXSLTemplate
    Set oXSLTemplate = Server.CreateObject("MSXML2.XSLTemplate.3.0")
    Set oXSLTemplate.stylesheet = oXSLDocument
    
    Set Application("CachedTemplate") = oXSLTemplate
    
    Set oXSLDocument = Nothing
    Set oXSLTemplate = Nothing
    %>
    					
  2. Save the following code as File2.asp:
    <%
    '=============================================
    ' File2.asp - Each run consumes memory, without
    ' releasing it.
    
    Dim oInputDoc
    Dim oResourceDoc
    Dim oXSLProcessor
    
    Set oInputDoc = Server.CreateObject("MSXML2.DOMDocument.3.0")
    oInputDoc.loadXML "<Test>" & Now() & "</Test>"
    
    Set oResourceDoc = Server.CreateObject("MSXML2.DOMDocument.3.0")
    oResourceDoc.loadXML "<Resources/>"
    
    Set oXSLProcessor = Application("CachedTemplate").createProcessor()
    oXSLProcessor.input = oInputDoc
    oXSLProcessor.output = Response
    
    'Remove this line to stop the leak.
    oXSLProcessor.addParameter "resources", oResourceDoc.documentElement
    
    oXSLProcessor.transform()
    
    Set oResourceDoc = Nothing
    Set oInputDoc = Nothing
    Set oXSLProcessor = Nothing
    %>
    					
  3. Save the following code as Test.xsl:
    <?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
    	<xsl:template match="http://support.microsoft.com">
    	  XSL output: <xsl:value-of select="Test" />
    	</xsl:template>
    </xsl:stylesheet>
    					
  4. Test the application under stress:
    1. Set up a new virtual folder and copy File1.asp, File2.asp, and Test.xsl to the virtual folder.
    2. Configure the new virtual folder to run in High Isolation - Out of Process, so that the ASP application runs under a separate copy of Dllhost.exe.
    3. From your browser, run File1.asp.
    4. From your browser, run File2.asp repeatedly.
    5. To view memory usage, start Windows Task Manager and click the Processes tab. One instance of Dllhost.exe shows linear growth in memory usage, corresponding to the memory leak.

APPLIES TO
  • Microsoft XML Parser 3.0
Keywords: 
kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB293080
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Saradhi - uvnpsaradhi NOSPAM-AT-NOSPAM yahoo.com Report As Irrelevant  
Written: 2/1/2006 2:37 AM
Does anybody had a solution to this problem?