![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
AddMemoryPressure() is new in Whidbey. Jim Cheshire [MSFT] MCP+I, MCSE, MCSD, MCDBA Microsoft Developer Support jamesche (AT) online (DOT) microsoft.com This post is provided "AS-IS" with no warranties and confers no rights. |
#2
| |||
| |||
|
|
Hi All, First of all, thanks for all of your replies. I found the cause for the memory leak. It is .... XslTransform xslt = new XslTransform(); xslt.Load(Server.MapPath("NewInteraction.xslt")); .... This abysmally leaks UnManaged memory for each call!! The following App proves that: using System; using System.Xml; using System.Xml.Xsl; namespace xslt { class Class1 { [STAThread] static void Main(string[] args) { XmlDocument Xmlsectiondoc = new XmlDocument(); for(int i=0; i<1000; ++i) { Xmlsectiondoc.Load("E:\\Debug\\Bugs\\xmldoc.xml"); XslTransform xslt = new XslTransform(); xslt.Load("E:\\Program Files\\Interaction.xslt"); XmlDocument resultdata = new XmlDocument(); XmlReader reader = xslt.Transform(Xmlsectiondoc,null); resultdata.Load(reader); string m_sHTML = resultdata.InnerXml; if((i%10)==0) { Console.WriteLine(i.ToString() + "." + " Calling GC.Collect()"); GC.Collect(); } } Console.ReadLine(); } } } MicroSoft : When will this issue be fixed? Thanks Chetan Raj jamesche (AT) online (DOT) microsoft.com (Jim Cheshire [MSFT]) wrote in message news:<bZozR#5gEHA.2640 (AT) cpmsftngxa06 (DOT) phx.gbl>... AddMemoryPressure() is new in Whidbey. Jim Cheshire [MSFT] MCP+I, MCSE, MCSD, MCDBA Microsoft Developer Support jamesche (AT) online (DOT) microsoft.com This post is provided "AS-IS" with no warranties and confers no rights. |
#3
| |||
| |||
|
|
Use Dispose() method in every unmanaged objects after you have used and won't be used any more. This method will release all memory it used up while it was working. "Chetan Raj" <hichetu (AT) gmail (DOT) com> ??? news:27b710b1.0408182300.77cb9374 (AT) posting (DOT) google.com ???... Hi All, First of all, thanks for all of your replies. I found the cause for the memory leak. It is .... XslTransform xslt = new XslTransform(); xslt.Load(Server.MapPath("NewInteraction.xslt")); .... This abysmally leaks UnManaged memory for each call!! The following App proves that: using System; using System.Xml; using System.Xml.Xsl; namespace xslt { class Class1 { [STAThread] static void Main(string[] args) { XmlDocument Xmlsectiondoc = new XmlDocument(); for(int i=0; i<1000; ++i) { Xmlsectiondoc.Load("E:\\Debug\\Bugs\\xmldoc.xml"); XslTransform xslt = new XslTransform(); xslt.Load("E:\\Program Files\\Interaction.xslt"); XmlDocument resultdata = new XmlDocument(); XmlReader reader = xslt.Transform(Xmlsectiondoc,null); resultdata.Load(reader); string m_sHTML = resultdata.InnerXml; if((i%10)==0) { Console.WriteLine(i.ToString() + "." + " Calling GC.Collect()"); GC.Collect(); } } Console.ReadLine(); } } } MicroSoft : When will this issue be fixed? Thanks Chetan Raj jamesche (AT) online (DOT) microsoft.com (Jim Cheshire [MSFT]) wrote in message news:<bZozR#5gEHA.2640 (AT) cpmsftngxa06 (DOT) phx.gbl>... AddMemoryPressure() is new in Whidbey. Jim Cheshire [MSFT] MCP+I, MCSE, MCSD, MCDBA Microsoft Developer Support jamesche (AT) online (DOT) microsoft.com This post is provided "AS-IS" with no warranties and confers no rights. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |