So we're stress testing an ASP.NET application developed by an external company. We're doing roughly 50 requests per second, and after about half an hour each of the 48 worker process (w3wp.exe) is up to about 400 MB and counting. Running on IIS7.
Now after meddling with dotTrace, I'm fairly certain there is a memory leak here, but it's hard to be 100% certain without knowing the application. When we confronted the developers with this theory they dismissed it after 30 seconds saying something like "memory is handled automatically in .NET". Surely .NET would have garbage collected 48x~400MB if it was finalized data?
Anyway, I'm used to working with WinForms. How exactly do one create memory leaks in ASP.NET? Is the ONLY way by (mis)using the Application and Session objects in .NET?
edit
I have since posting this question learned that holding static references to objects in the request handlers (be it a web service class, web form or whatever) will cause "leaks". Probably not the correct term here, but anyway... This I was unsure of, because I thought the handler classes were killed and recreated after each request by IIS.
So code like this:
public class SomeService : IService
{
public static List<RequestData> _requestDataHistory = new List<RequestData>();
public void SomeRequest(RequestData data)
{
_requestDataHistory.Add(data);
}
}
WILL crash your server sooner or later. Maybe this was obvious to most people, but not to me :-)
Still unsure whether or not this would be a problem if you removed the static keyword though. Are instances disposed after each request?