HighTechTalks DotNet Forums  

Re: ASP.NET UnManaged Memory Shoots Up,

Dotnet Framework microsoft.public.dotnet.framework


Discuss Re: ASP.NET UnManaged Memory Shoots Up, in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Re: ASP.NET UnManaged Memory Shoots Up, - 08-19-2004 , 03:15 AM






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>...
Quote:
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.

Reply With Quote
  #2  
Old   
Parco
 
Posts: n/a

Default Re: ASP.NET UnManaged Memory Shoots Up, - 09-05-2004 , 03:14 PM






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 ???...
Quote:
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.



Reply With Quote
  #3  
Old   
Glenn Miller
 
Posts: n/a

Default Re: ASP.NET UnManaged Memory Shoots Up, - 09-20-2004 , 07:59 AM



I've been following this with great interest, because I'm seeing the same
thing in one of my COM objects. I've checked the object by invoking it from a
VB 6 program and running Purify against it--absolutely no memory leaks or
overwrites, no COM leaks, no handle leaks. I've done all the stuff suggested
earlier in this thread, including using ReleaseComObject in a loop.

I'd like to give the Dispose method a try...do I just invoke it from the
object? For example, something like:

MyCOMObj.Dispose()

By the way, the symptom I am seeing is that the first time an instance of
the COM object is allocated by apsnet_wp, its memory usage jumps from about
4M to about 25M. Then, every use thereafter increases by about 16K...which is
not much, but it does add up.

"Parco" wrote:

Quote:
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.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.