Wednesday

How to find memory leak in .net application:


1.Create dump file of application process in windows , you can use this tool

DebugDiag (free tool from Microsoft)
Open it, go to "process" tab and select "create dump file"
2. Download and install
windbg
Start windbg and drag dump file there.
3.if it's dot.net you have to load sos extension , in windbg command line , type:
.loadby sos mscorwks
4.then !dumpheap -stat you will get list of all .Net objects in memory/dump
if you want to get specific instances , you can hit:
!dumpheap -mt [addr] - where [addr] is addr from left column in windbg
you will receive list of objects loaded into memory , by dump out do objects:
!do [addr] you will dump specific objects with it's properties.
when you do !do [addr] when [addr] of specific property you will get particular value of that property.
5.if you dumped web-application and see aspx pages this is not good.
you can get static objects by this command (it will show links on cache objects as well):
!gcroot [addr] where [addr] -- address of page in memory

As alternative you can use different analysis from [Analysis] tab in DebugDiag.
Memory Analysis gives a nice report.

No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...