Reputation: 93
We have an Asp.NET application holding all of our server logic. This application only accommodates the services (no pages).
From some reason after some time the w3wp.exe process memory consumption tends to bloat. It grows in a matter of seconds to the maximum size availble (in my server up to 10 gigabytes).
It happens unexpectedly, so we can't really recreate by demand.
I need some help with debugging this issue. Does anyone know of a good tool i can use? maybe something i can tell to dump the memory or take a snapshot when the process reaches some memory consumption.
Any help will be appreciated. Daniel
Upvotes: 1
Views: 202
Reputation: 65471
There are many good answers here on debugging.
Another way to approach the problem is using a code review.
There are many ways that memory can leak in a program. But for it to leak several GB in a few seconds is almost certainly due to a loop in your code.
So:
Upvotes: 2
Reputation: 706
If you can make it happen in a development environment then you should be able to use Visual Studio's built in profiling tools to track down the issue.
If this only happens in your production environment check this out: https://rpm.newrelic.com
Upvotes: 1
Reputation: 11164
Tess Ferrandez's blog is a great resource for debugging ASP.NET:
There are various ways to capture a memory dump that you can inspect with WinDbg and SOS offline:
Upvotes: 0
Reputation: 29071
Red Gate makes some very nice .NET profiling tools. I believe the memory profiler (which should help you find leaks) has an eval version that may be useful.
Some simple things to check:
Are you allocating any IDisposable objects (HttpWebRequest, WCF objects, anything that uses unmanaged resources or unsafe code) and not disposing them?
Do you have any queries that might be trying to load an entire very large table into RAM? (Unlikely) Check memory usage around any LINQ code that's manipulating SQL results.
Upvotes: 2