Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identifying memory problems in an ASP.NET application

I've got an ASP.NET application running and on the production box it's using about 450MB RAM, however, it shouldn't be using quite so much, and it seems to increase over time, so it seems there might be a leak or atleast something not being released properly.

I took a look with PerfMon and there was 416MB in GC Gen2.

Anyone have any idea for finding out what it's keeping in memory? Could I just grab dotTrace/ANTS and somehow attach it to my IIS (6 - on windows server 2003) - or is there a better way? :-)

Thanks.

like image 786
RasmusKL Avatar asked Nov 30 '08 22:11

RasmusKL


1 Answers

The classic problem of newing up a bunch of strings in a loop could cause the issue you're seeing due to large amounts of memory being allocated for new strings without releasing them. Are you using StringBuilder where appropriate?

like image 175
Søren Spelling Lund Avatar answered Oct 11 '22 21:10

Søren Spelling Lund