Visualizing Runtime Object Graphs

by clovett 15. January 2010 16:28

One of the first questions people seem to ask when they see the Dependency Graph features of Visual Studio 2010 is whether it can also be used to visualized runtime object graphs.

In this Video (WMV, or MP4) I will show you how that can be done using the SOS debugger extensions and specifically the GCRoot command.  I've used this technique several times to help figure out some really complex memory leak bugs and so I'm confident you will find this to be a useful tool to add to your toolbox of tricks.

The code for the GCRootToDGML tool is available to download so you can try this out yourself, it should work with any recent version of Visual Studio 2010.

Adding links some excellent work done by others on this subject below:

Tags:

Runtime | Visual Studio

Comments

8/25/2009 7:08:02 AM #

Pavan.

Great post! Is ther a way to automate the "dump gcroot output to .log file and then manually run your program". Is there a way to spawn it from the immediate window itself?

Thanks,
Pavan.

Pavan. United States

8/26/2009 9:15:51 PM #

Chris Lovett

I don't know the answer to your questions, but you are right, this is exactly the next step. Let me know if you find a solution Smile

Chris Lovett

8/30/2009 2:19:39 AM #

trackback

Amazing .NET Reference Visualizations

Half the battle when tracking down memory problems in a .NET application is seeing the reference chain

John Robbins' Blog

8/31/2009 7:41:08 AM #

Aaron Marten

Nice!

Aaron Marten United States

9/3/2009 5:24:32 PM #

Jandeep

Awesome post ! link to the Video is broken ..can you fix it?
thanks

Jandeep United States

9/4/2009 4:59:39 PM #

Chris

I added mp4 videos (slightly smaller) with links to screencast.com which should help.

Chris United States

10/24/2009 3:00:14 AM #

Gregory Babski

Nice work! I noticed in your video you felt forced to use !dumpheap to get the address of your player instance. You should be able to get it directly at the breakpoint you set with (in the immediate window):
&player
Which returns
0x0040ef2c
    player: 0x02669088
The nested address being the one of interest.

This works in VS2008 - not sure if it still does in VS 2010.

Gregory Babski South Africa

10/31/2009 4:24:52 PM #

Martin Connell

Thanks for the interesting video and the DGML visualizer looks quite sexy; but isn't your advice to watch out for object reference cycles kind of ironic given .NET/CLR was originally pushed as a solution to such woes?

Indeed, it might even bring a wry smile to the face of anyone who has stuck with C++ and stubbornly resisted the lure of neglecting the object reference graph at the design stage.

Martin Connell United Kingdom

1/2/2010 9:00:12 AM #

Robert

Thanks for the video. I've been wanting to implement a object reference graph, but had a few questions on some issues I was seeing. You covered it all in the video. Thanks again.

Robert United States

1/9/2010 10:03:56 AM #

James

Just wanted to say thank you for the video on visual studio 2010, i've never used the sos debugger plugin before and it came in handy. Cheers!

James United Kingdom

1/31/2010 10:38:22 PM #

Andre Gemmen

Great stuff my friend!  Visualizing Runtime Object Graphs was a wonderful read. Love reading stuff about this.

Andre Gemmen United States

2/11/2010 10:42:42 AM #

Calpe Villas

nice post.. I especially like the code to GCROOTtoDGML tool

Calpe Villas Spain

3/27/2010 8:54:45 PM #

Julio Rapko

"Simplicity is not the opposite of complexity. Simplicity is too often an excuse for being simplistic. The world doesn't need any more stupid software. The opposite of complexity is beautiful, elegant design."

I agree, for I have noticed that some software, especially computer games, are beautifully stable, while others crash like there is no tomorrow.

Julio Rapko United States

3/28/2010 3:07:29 AM #

Jordan retro 10

I only lately started out leaving comments! Makes me think a small way more about what I enjoyed and learned in regards to the post! Superb tips, thanks!

Jordan retro 10 People's Republic of China

3/29/2010 3:18:08 AM #

Aurea Gillen

great job on the videos. i really enjoyed watching them. keep up the good work...

Aurea Gillen United States

4/6/2010 2:52:30 AM #

car hire france airport

great job on the videos. i really enjoyed watching them.keep going buddy.........

car hire france airport United States

4/9/2010 1:09:53 AM #

Mark

The Videos are great. Thx for this useful tip with the sos debugger.

ciao from germany

Mark Germany

4/23/2010 3:42:28 PM #

Money Origami

Great post by videos. I especially like the videos. I especially like the code to GCROOTtoDGML tool

Money Origami United States

4/23/2010 5:10:26 PM #

projector lights

Nice post i just wants to offer my thaks for the video on visual studio 2010 . Infact i love to know more about this.

projector lights United States

4/24/2010 4:27:28 PM #

Ultimate WOW Guide Review

Cheers for the awesome video, the visualizer, and the code to GCROOTtoDGML tool is tidy. I've been searching for an object reference graph. You've covered everything I think. Cool.

Ultimate WOW Guide Review United States

4/27/2010 2:35:50 PM #

Florida Phone Systems

The visualized runtime object graphs are a great time saver when using the Dependency Graph features of Visual Studio 2010.  However, they are definitely difficult to use, and I appreciate the guide.

Florida Phone Systems United States

5/11/2010 3:36:51 AM #

Money Origami

It great to know about visualized runtime object graphs as they are great time saver when using the Dependency Graph features of Visual Studio 2010. Thanks for great information about Visual Studio 2010.

Money Origami United States

5/11/2010 5:29:09 PM #

Greener Life

Thanks for nice tutorial!

Greener Life United Kingdom

5/12/2010 7:51:47 AM #

house extension costs

I love visualising runtime graphs now after your article, cheers.

house extension costs United States

5/12/2010 7:51:49 AM #

Father's Day Gift Ideas

Excellent! Ive now added GCRootToDGML to my tool collection. Thanks for upping the link location.

Father's Day Gift Ideas United Kingdom

5/12/2010 2:43:41 PM #

Enclosed cargo trailer

Great post! Is there a way to automate the production program. Is there a way to spawn the immediate window itself?

Enclosed cargo trailer United States

5/13/2010 6:28:35 AM #

Low Cost Auto Insurance

Thanks for the video. I've been wanting to implement a object reference graph and you made it so simple to understand.  just wanted to let you know your help is really appreciated.

Low Cost Auto Insurance United States

5/18/2010 5:32:50 AM #

Soccer

Thanks for posting your video.  

It is so much easier to understand by watching rather than reading.

Soccer United Kingdom

5/19/2010 4:59:28 AM #

what is neuropathy

This was really very helpful information. I really appreciate everything.

what is neuropathy United States

5/19/2010 12:36:39 PM #

Boat trailer wheels

Thanks for the interesting video and the DGML visualizer looks quite good.

Boat trailer wheels United Kingdom

5/20/2010 3:23:28 PM #

roger t

Thanks for the interesting video. Learning to use GCRootToDGML hasn't been easy!

roger t United Kingdom

5/21/2010 6:29:03 PM #

Opony

Thanks for good article. Hope to see more soon.

Opony United States

5/22/2010 8:39:53 AM #

saint paul computer repair

Great video!  It really helped me a lot.

saint paul computer repair United States

5/23/2010 1:56:20 AM #

Web Design Inspiration

Awesome post, can I link to this from my website?

Web Design Inspiration United States

5/23/2010 4:18:36 PM #

puppy potty training

Extremely amazing post. The author has given a perfectly explain how to visualize Runtime object graph. Thank you for sharing this update. We will be waiting for more exciting post.

puppy potty training United States

5/25/2010 5:44:15 AM #

QQ

now added GCRootToDGML to my tool collection. Thanks for upping the link

QQ Senegal

5/28/2010 2:33:06 PM #

Universal Studios Tickets

Thanks, now off to play with the SOS debugger..

Universal Studios Tickets United States

5/28/2010 3:50:13 PM #

Rosh

This is really great info. Thank you for sharing it with us!

Rosh

5/28/2010 9:44:09 PM #

Schildersbedrijf Rotterdam

I didn't think about visualizing this. It sure looks like a great tool to help track down bugs!

Schildersbedrijf Rotterdam Netherlands

5/30/2010 6:29:53 AM #

Roger Gordon

Thanks for posting your video. the information is very useful.

Roger Gordon United Kingdom

6/1/2010 6:32:17 PM #

Edwin

Thanks I was looking into GCRoot and your video helped me a bit more on my way

Edwin Netherlands

6/12/2010 4:56:32 AM #

ice vending man

Is ther a way to automate the "dump gcroot output to .log file

ice vending man United States

6/26/2010 8:46:18 PM #

dog boy john

Just wanna say thanks for the heads up, helpful vid on GCRootToDGML tool.

dog boy john United States

6/30/2010 10:30:26 AM #

vending machines

I wish that it were still so easy; fixing bugs that related to memory leaks and user-related issues.  Lately, I've been coming across loads of injections and the like.  I can't imagine why people want to destroy things.  I feel like I'll be eating from a vending machine my whole life because I don't have time anymore to eat let alone figure out what the latest is on the "seek and destroy perfectly good websites" front.

vending machines United States

6/30/2010 12:03:58 PM #

Vending machines

I love that you posted this video!  I did it myself with the code that you provided just to say I did it. I'm digging where graphics are going these days!!!

Vending machines United States

8/9/2010 8:33:14 AM #

Jim Stegen

Excellent post.  I'll give that gcroot tool a try.

Jim Stegen United States

8/10/2010 2:01:54 AM #

Tony

Thanks for the video. I've been wanting to implement a object reference graph and you made it so simple to understand.  just wanted to let you know your help is really appreciated.

Tony Australia

8/18/2010 5:09:45 AM #

EMR transcription company

Hi Clovett.. you're provided video is a very huge help, it gives a solutions specially the link of the Tool which I downloaded and Yes, it works on Visual Studio 2010. You did a great job! this post will also help to other people seeking for this extension.

Once again, thank you.

EMR transcription company United States

9/14/2010 11:10:49 PM #

theory test

Great video, first time i've seen this being used, will have to give a go. added +rating

theory test United Kingdom

10/14/2010 5:51:14 AM #

AutoBlog Samurai Review

Excellent work on videos mate. Loved It

AutoBlog Samurai Review United Kingdom

10/22/2010 10:15:52 PM #

crystal

Thanks for the awesome post.

crystal United States

11/12/2010 11:38:00 AM #

moving London

Thanks .... really needed the GCRootToDGML tool, came in handy with other stuff ....and liked the video too

moving London United States

11/26/2010 8:22:45 AM #

Tom Andrews

Videos are great.. worked perfectly.. thanks!!!

Tom Andrews Australia

11/26/2010 8:27:05 AM #

Kate Smith

Really helpful videos.. thanks

Kate Smith Australia

11/27/2010 9:14:58 AM #

NewGadgetBlog

Hi there. Thank you for the tutorial. Unfortunately I am having a problem with the code for the GCRootToDGML tool . The link appears to be dead. Maybe someone can post another link,please?

Thank you

NewGadgetBlog United States

11/30/2010 8:14:02 AM #

Car Games

I have tested GCRootToDGML tool in Visual studio and worked like a charm...Thanks for this useful tool !

Car Games Portugal

12/3/2010 6:26:00 AM #

Gaini de rasa

I like this.Dependency Graph features of Visual Studio 2010.  However, they are definitely difficult to use, and I appreciate the guide.

Gaini de rasa United States

12/6/2010 3:10:45 PM #

Brett Mont

Very helpful videos... please keep them coming.

Brett Mont United States

12/11/2010 10:52:07 AM #

marketing push

you're provided video is a very huge help, it gives a solutions specially the link of the Tool which I downloaded and Yes, it works on Visual Studio 2010.

marketing push France

12/12/2010 2:19:37 AM #

ile de ré

GCRootToDGML is an excellent tool, nice vid!!

ile de ré France

12/13/2010 2:23:54 AM #

UAE offshore company

Thank you very much for the videos on visual studio 2010! They were really very helpful.

UAE offshore company U.A.E.

12/13/2010 2:40:14 AM #

Mike

Thanks a lot! The GCRootToDGML tool is absolutely what I needed! And the video was also great!

Mike Singapore

12/28/2010 10:31:32 PM #

model search 2011

Hey man great video this will definitely come in handy.  Also, thanks for the link to the  GCRootToDGML tool itself...I'm definitely going to be trying this out.

model search 2011 United States

12/29/2010 8:52:32 PM #

Lake Erie Fishing

Been trying to get a grasp of Visual Studio 2010 for the last month. resources such as your own have proved to be an immense help along the way

Lake Erie Fishing United Kingdom

12/31/2010 9:17:47 AM #

Harry

I've been wanting to implement a object reference graph and you made it so simple to understand.  just wanted to let you know your help is really appreciated.

Harry United States

1/3/2011 11:53:45 AM #

flecx

Short yet concise, I had never used SOSdebugger before hopefully it will shave a few hours off a couple of problematic projects!

flecx United Kingdom

1/6/2011 8:35:56 AM #

sem

Yeah, Mohamed El-Geish extension works great. Indeed graphs can easily interact with Visual Studio 2010. Thanks for the post& link.

sem United States

1/6/2011 9:07:12 PM #

Janile Evans

I haven't used much my studio visual tool and I'm yet to actually grasp its usage properly. In your video you have shown me helpful ideas on it. I haven't tried using the SOSdeblugger before and hopefully it can help fix some of my problems. Also many thanks for the GCRootToDGML tool download. Hopefully it can help me as well.

Janile Evans Republic of the Philippines

1/12/2011 7:59:14 AM #

Sarah

This is great and I appreciate this. Thanks a lot!

Sarah United States

Comments are closed

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

RecentPosts