Tim's .NET Software Architecture Blog

Adventures in Architecting and Developing .NET Applications


News

Technorati Profile

Listed on BlogShares

My Stats

  • Posts - 160
  • Comments - 63
  • Trackbacks - 57

Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Blogs


Link Blogs


Links


Podcasts



One of the most frustrating challenges we have to deal with when we create an application is a memory related problem. These may actually manifest themselves as out of memory exceptions or possibly slow downs as the system waits for resources. Diagnosing the cause of these problems requires cunning and perseverance.

So how do you go about finding the offending piece of code when your application contains several layers and thousands of lines of code. The answer is to dig into your bag of wizard’s spells and exercise the demons to send them back to the beyond.

Ok, that is a little dramatic. The real answer is to get a profiling or analysis tool. There are several out there. Some are free. Of course the ones with all the bells and whistles will set you back the price of a few first person shooter games.

While I was doing some diagnosis recently I ended up working with Dev Partner’s Memory Analysis, Red Gate’s ANTS, as well as the CLR Profiler and DebugDiag from Microsoft. This is by no means a complete list of what is available, just what I have tried. They each have their strong points and aggravations.

Memory Analysis has a really nice real time graph of the memory being allocated system. This helps as you are stepping through code to tell you at what point you app becomes a pig. The problem is that it isn’t good at telling you which object is bellying up to the buffet.

For the detailed level and ease of reading I actually found that CLR Profiler did a nice job. The allocation graph gives you a tree diagram that is easy to follow and allows you to drill down when you find a point of interest.

In the end I found that this is a process that still takes a lot of basic troubleshooting skills. Changing your code to exercise different scenarios and building test apps to isolate suspected thieves are crucial tasks. I hope this little bit of information can help some of you out there if you run into this type of situation.


posted @ Saturday, October 07, 2006 1:43 AM | Filed Under [ .NET ]

Comments

Gravatar # re: .NET Memory Analysis
Posted by Ruth Castillo on 2/20/2008 3:30 PM
Hello.

I'm tring to build an aplication to Analize memory, but i don't find any information about it, i want to know if you want to help me with it.

Thanks.
Gravatar # re: .NET Memory Analysis
Posted by Tim Murphy on 2/22/2008 8:39 AM
I am always interested in learning new things. Unfortunately I am already working on a number of projects, personal and work, which leaves me too little time to start another right now. I would love to see what ideas you are working on though.
Gravatar # re: .NET Memory Analysis
Posted by sujit singh on 5/30/2008 1:31 AM
where can I get Devpartner Studio Professional Edition. I need to try it before I make any decision of purchasing it
Gravatar # re: .NET Memory Analysis
Posted by Tim on 5/30/2008 5:41 AM
http://www.visualstudiogallery.com/ExtensionDetails.aspx?ExtensionId=0c812839-0a95-47af-bde7-cc5c8da501d2
Gravatar # re: .NET Memory Analysis
Posted by sujit singh on 5/30/2008 6:03 AM
Hi Tim,

Thanks for the link. I have already filled the registaration form yesterday, but they haven't contacted me yet. May be because I am in India, they wouln't have.
So I still don't have luck with the software. Can u send me a link from where I can download it ? or can u send me the software itself via email (trial version).

Regards
sujit
Post a comment





 

Please add 8 and 2 and type the answer here: