Are your .NET apps leaking memory?

Recently I heard word from a colleague that a .NET application that we had written is leaking memory, or at least appears to be.  Over the course of a month our asp.net application slowly increases its memory consumption until the server gets bogged down and is rebooted.  The memory consumption reaches about 1GB when the month "mark" rolls around.  The site will then run for another month, and again slowly increase its memory consumption to 1GB.  I haven't done a review of the code as of yet but will be doing so shortly to ensure everything is in order. 

Are you seeing memory leaks in any of your applications?  If so do you have any tips, pointers, or advice on tracking down the problem?

# Here's how I track down memory leaks in my .Net apps - level 400

Wednesday, August 18, 2004 7:13 AM by Jeffrey Palermo    
Here's how I track down memory leaks in my .Net apps - level 400

# re: Are your .NET apps leaking memory?

Wednesday, August 18, 2004 7:56 AM by Paul Wilson    
I've a few leaks, most due to some unmanaged leaks in 3rd party super controls that shall remain nameless. As for real .NET leaks, we found one in an obscure use of Xml Serialization and one in WinForm context menus -- both noted on my blog some months back. Tracking these down was a slow process involving taking lots of memory snapshots, which is much too slow to be something you really want to do. :)

# re: Are your .NET apps leaking memory?

Wednesday, August 18, 2004 10:49 AM by Dave Donaldson    
The only advice I can give is to execute long-running stress tests with the GC performance counters turned on. I suggest doing a "soak" test, which is where you run at about 3x expected normal load for about 7 days non-stop. Use a tool like LoadRunner (or something similar, but ACT won't be enough) and do a lot of analysis on the results. This should be enough to identify serious memory leaks.

# re: Are your .NET apps leaking memory?

Wednesday, August 18, 2004 10:57 AM by JosephCooney    
I thought using the "memoryLimit" attribute of the "processModel" config element you could get the ASPNET worker process to be recycled after it had consumed a certain amount of memory. The default is 60%. I am surprised that this is even happening.

<a target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfprocessmodelsection.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfprocessmodelsection.asp</a>

# re: Are your .NET apps leaking memory?

Wednesday, August 18, 2004 11:54 AM by marko rangel    
You could try to get memory dumps using Microsoft's Debugging tools for Windows. Get a few hang dumps at various intervals during the month, CLR Profiler to see what the GC is doing...

# re: Are your .NET apps leaking memory?

Wednesday, August 18, 2004 8:08 PM by John Rusk    
This is interesting, although I'm not sure whether it's relevant to your situation: <a target="_new" href="http://blogs.msdn.com/ericgu/archive/2003/12/08/52964.aspx">http://blogs.msdn.com/ericgu/archive/2003/12/08/52964.aspx</a>

# re: Are your .NET apps leaking memory?

Saturday, August 21, 2004 12:27 PM by Jeff Gonzalez    
Taking a memory dump analysis with vadump is key. We called PSS and let Microsoft do the dirty work. Going through memory dumps can be a painful and tedious process.

# re: Are your .NET apps leaking memory?

Saturday, August 21, 2004 12:39 PM by Jeff Gonzalez    
Taking a memory dump analysis with vadump is key. We called PSS and let Microsoft do the dirty work. Going through memory dumps can be a painful and tedious process.

# re: API Based XML Streaming & Functional OO Programming

Tuesday, October 16, 2007 2:29 AM by xert    

Post a Comment

 
 
Prove you're not a spammer: 
0 + 1 =