XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Adam Van den HovenSubject: Memory problems
Author: Adam Van den Hoven
Date: 07 Sep 2001 05:29 PM
Hey guys,

I've discovered some really scarry memory issues, I'm attaching the files I used. If I step through the code, within a few steps my memory usage shoots up. If I keep going, or simply run without steping, I quickly run out of virtual memory and have to do a hard reboot. The problem seems to be tied with the use of variables containing nodesets since if I store strings (via the string() function) the problem is greatly reduced.

Here's what my rough measurement of the problem. What I did was open all the files I've attached and then place a breakpoint on the {xsl:template match='/'} line. I then recorded the total memory usage (as reported by the statusbar of taskmanager) before running. I then started the processor and recored the memory at step 0. Each time I pressed F11, I recorded the memory usage and the line where the arrow was pointing after pressing F11 (so after the first step the pointer was on the comment line). Once the memory usage approached 600megs, I quit the process, restarted stylus studio and ran the _fixed template in the exact same fashion

Open Files:
getItemResourceURL.xsl
getItemResourceURL_fixed.xsl
Configlib.xsl
config.xml

In both getItem*.xsl files place a breakpoint on the line:

step through the original then the _fixed files














Memory Usage
StepusagePointer on
before123072
0193212template match="/"
1192992Comment line
2193008first variable
3196136Second variable line
4254808Call-template line
5255684template name=ResolvePath in config.xsl
6255796path pathnodes
7254836path pathid
8309532path pathtype
9420444variable CurrentPath
10Quit the process when the memory usage got over 590000k



_fixed:















Memory Usage
StepusagePointer on
before124180
0193004template match="/"
1193008Comment line
2192128first variable
3197076Second variable line
4197056Call-template line
5197092template name=ResolvePath in config.xsl
6197096path pathnodes
7197100path pathid
8197100path pathtype
9197104variable CurrentPath
10197120choose




ApplicationConfigLib.xsl


DocumentConfig.xml

Postnext
Adam Van den HovenSubject: Memory problems
Author: Adam Van den Hoven
Date: 07 Sep 2001 05:32 PM
OOps here are the rest... and those tables (I thought it was going to reneder the HTML correctly) in tab delimited:
orig
Memory Usage

Step orig Pointer on
before 123072
0 193212 template match="/"
1 192992 Comment line
2 193008 first variable
3 196136 Second variable line
4 254808 Call-template line
5 255684 template name=ResolvePath in config.xsl
6 255796 path pathnodes
7 254836 path pathid
8 309532 path pathtype
9 420444 variable CurrentPath
10 Quit the process when the memory usage got over 590000k


_fixed:

Memory Usage

Step orig Pointer on
before 124180
0 193004 template match="/"
1 193008 Comment line
2 192128 first variable
3 197076 Second variable line
4 197056 Call-template line
5 197092 template name=ResolvePath in config.xsl
6 197096 path pathnodes
7 197100 path pathid
8 197100 path pathtype
9 197104 variable CurrentPath
10 197120 choose


DocumentgetItemResourceURL.xsl


DocumentgetItemResourceURL_fixed.xsl

Postnext
Adam Van den HovenSubject: Memory problems
Author: Adam Van den Hoven
Date: 07 Sep 2001 05:37 PM
One more thing, you should probably set the id 'CmpStack', although I didn't when I ran my tests.

Postnext
Minollo I.Subject: Re: Memory problems
Author: Minollo I.
Date: 07 Sep 2001 05:40 PM
Thanks Adam; we'll run your testcase so that we can see what's going on.
We'll keep you posted.
Minollo

Posttop
Minollo I.Subject: Re: Memory problems
Author: Minollo I.
Date: 10 Sep 2001 03:43 PM
Adam,
we have worked hard during the weekend to understand the source of the
problem you have reported. We have found a couple of issues that were
making the XPath processor leak huge amounts of memory when executed on the
type of XPath expressions you are using, and also a big performance issue
when working on variables containing node-sets (as you suspected).

The good news is that we have been able to fix both issues, and that now
your testcase stylesheet is processed in less than two seconds (compared to
a similar result using MSXML and to about 5 minutes using Xalan-J) with
stable memory consumption.

We are now running regression tests; if everything goes smoothly we will
release a build containing these (and other fixes) later this night or
tomorrow.

Thanks for your help and patience,
Minollo

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.