23,000+ live instances after 3 snapshots!??

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Posts: 1
Joined: Tue Jun 03, 2008 3:45 pm

23,000+ live instances after 3 snapshots!??

Post by mabaza » Tue Jun 03, 2008 3:56 pm

We just recently migrated a large VB6/ASP application to ASP.NET using both automated and manual conversion techniques. The resultant app is not pretty, but time and monetary constraints prevented a true re-write. The application uses XSLT to transform various XML structures into HTML. Therefore, it relies heavily on XML (i.e String) manipulation. Unsurprisingly, the application is gobbling up tons of memory, causing the IIS worker process to recycle every 10 mins on a Windows 2003 box loaded with 4GB of RAM.

Thankfully, we have a few weeks before the app goes into production. After serving four pages, the .NET Memory Profiler (we purchased the standard edition), indicates that there are over 23,000 live objects and only 143 objects that have been GC'd. System.String and System.Int32[] are the top 2 offenders.

The glut of information provided by the tool is a little overwhelming. How can I find out why these objects are not being collected? Any advice on how to proceed is much appreciated.

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Wed Jun 04, 2008 3:21 pm

If there are a lot of classes with new instances you can try to identify a class that you have some knowledge about, for instance a class that's part of your application (and not the framework). If you can find such a class with new instance and you don't believe that is should have, then this is a good candidate for your investigations. Or you can look for classes with disposed instances, as they often indicate memory leaks.

To minimize the amount of new instances it is also recommended that you do as little as possible between the snapshots. For instance, try to only request a single page between the snapshots. If you still have new instances, you might have fewer classes to investigate. If not, try to request another page and see if that creates new instances.

One obstacle when profiling ASP.NET applications is caching and session state. In order to minimize the impact caused by this, try to lower the timeouts for the cache and session, and wait for the timeout to elapse before collecting the next snapshot.

If you need help analysing a profiler session, please contact us at support@scitech.se and we will give you information on how to upload the session file to us.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Posts: 1
Joined: Tue Jun 17, 2008 7:07 pm

Memory Leak with XMLSerialization

Post by Elfmanne » Tue Jun 17, 2008 7:10 pm

Since you mention that your app is heavy on the XML side...

Check this out: http://blogs.msdn.com/tess/archive/2006 ... 32804.aspx

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 11 guests