Re: Resource Leak from XslCompiledTransform
- From: "W. Jordan" <wmjordan@xxxxxxx>
- Date: Sun, 21 May 2006 09:32:55 +0800
Hello,
I set up a smaller environment and tested with two simple XSLT files.
One had a small script inside and the other one did't.
The consumption of memory goes up as you said and I observed that
the Bytes of the Loader Heap of the process was increasing everytime
I did trasformations with the XSLT file that has a script.
The memory leaks in XSLT with scripts are not yet fixed in .net 2.0.
And actually this is my real headache. I don't wanna compel others to
use extension objects instead of scripts, yet the loaded script can not be
unloaded as you have said. Perhaps a separated AppDomain is the
way to go, if we are to have the application to survive a little longer and
keep its memory consumption at a reasonable level.
Thanks for all that has replied.
--
Best Regards,
W. Jordan
"Oleg Tkachenko [MVP]" <some@xxxxxxxx> wrote in message
news:Oq9997aeGHA.1272@xxxxxxxxxxxxxxxxxxxxxxx
I don't think there is any difference between obsolete XslTransform and
XslCompiledTransform with regards to scripts. XslTransform leaks the same
way, see http://support.microsoft.com/?id=316775. And this has nothing to
do with XslCompiledTransform, you just cannot unload assembly in .NET.
Use extension objects instead of scripts.
--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com
W. Jordan wrote:
Hello,
Thanks for pointing out that.
Actually I really suspect that whether the XslCompiledTransform should
replace the old XslTransform class, which looks lightweight and easier to
manipulate. If we cache the XslTransform objects into the memory,
just as we (they did in the discussion in the forums) might do in our
practices, once the XslTransform is loaded, it is there. And there won't
be any trash files in the temp folder, nor will the memory consumption
increase as we load (reload) more and more stylesheets--yes, in my
ASP.net application, we have the application automatically reload the xsl
files if they are modified during the runtime. The auto-reload, but
non-memory-
leak feature is quite important for ASP.net applications which are
expected
to run long. If we use the XslCompiledTransform class, this won't be a
viable approach since every time we reload the stylesheet, the memory
consumption increases and after several scores of reloading, the ASP.net
application will hog a monstrous amount of memory, which is obviously
neither desirable nor necessary.
So, I personally will turn back and stick to the lagacy one, XslTransform
class, for not having to clean up temp files, nor worrying about memory
consumptions.
.
- References:
- Re: Resource Leak from XslCompiledTransform
- From: Oleg Tkachenko [MVP]
- Re: Resource Leak from XslCompiledTransform
- Prev by Date: Re: Insert XML string into Document
- Next by Date: DataSet nested relations
- Previous by thread: Re: Resource Leak from XslCompiledTransform
- Next by thread: Losing space character value when writing attribute
- Index(es):
Relevant Pages
|