Red Gate forums :: View topic - How to find instance from object retention graph?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Memory Profiler Previous Versions
ANTS Memory Profiler Previous Versions forum

How to find instance from object retention graph?

Search in ANTS Memory Profiler Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
ScottLangham



Joined: 23 Oct 2009
Posts: 5

PostPosted: Fri Oct 23, 2009 5:38 pm    Post subject: How to find instance from object retention graph? Reply with quote

In the instance list I've found an instance that I was expecting should have been cleaned up.

So, I looked at the object retention graph for this instance. There's an interesting instance in the list of instances that reference the leaked object. I'd like to look at the properties of this instance. So, I clicked on the interesting instance to select it on the graph, and then I switched back to the instance list.

I'm expecting the instance I selected on the graph to be selected in the instance list so that I can look at it's properties in the hopes of identifying it from the properties, but it's not selected. There are hundreds of instances in the list.

How, from an Object Retention Graph do I view the properties of a particular instance I've found on the graph?
Back to top
View user's profile Send private message
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Sun Oct 25, 2009 9:12 pm    Post subject: Reply with quote

One way to do it is to right click the object and choose "Show Object Retention Graph for this object". That'll make the "current" object the one you've chosen, so if you then go to the instance list, it'll be selected.

Hope that helps,
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
ScottLangham



Joined: 23 Oct 2009
Posts: 5

PostPosted: Wed Oct 28, 2009 12:00 pm    Post subject: Reply with quote

Hi Alex.

What you described is what I thought should happen too, but it doesn't.

In visual studio created a C# Windows Application and changed Form1.cs to this:

namespace WindowsApplication1
{
class A
{
public A(string n)
{
name = n;
}

string name;
public B b;
};

class B
{
};


public partial class Form1 : Form
{
A a1 = new A("a1");
A a2 = new A("a2");
A a3 = new A("a3");
A a4 = new A("a4");
A a5 = new A("a5");

public Form1()
{
InitializeComponent();

a3.b = new B();
}
}
}


Then followed these steps:
* Run this app with the memory profiler
* Capture a snapshot
* Go to the class view
* Select the 'B' class and go to the instance view
* There should only be one instance, select it and go to the object retention graph
* There is an A object referencing the B instance. Select the A object, right click and choose ' Show object retention graph for this A'.
* Now, press on the 'Instance List' button to switch back to that view.

=> No row seems to be selected. The top row has the '+' icon to the left of the class name. I don't think that means that row is selected though. If I press on the + to see the properties of that instance, it says it's name is "a1".
=> The instance that should be referencing the B instance should have "a3" as its name. I don't appear to be able to find this information from ANTS memory profiler.

Any further help would be appreciated.

-Regards,
Scott
Back to top
View user's profile Send private message
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Wed Oct 28, 2009 12:07 pm    Post subject: Reply with quote

I understand. I've tried to follow my own instructions, but as you say, they didn't work. I'm afraid there is no way to find the details about an instance from the object retention graph in this version. I'll add it as a request for the next version.

Thanks,
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
ScottLangham



Joined: 23 Oct 2009
Posts: 5

PostPosted: Thu Oct 29, 2009 1:39 pm    Post subject: Reply with quote

Ok. Great, it would be a useful feature. Thanks.
Back to top
View user's profile Send private message
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Thu Dec 10, 2009 6:52 pm    Post subject: Reply with quote

I've just tried this again to help another customer, and it seems to work in some situations. I'm baffled now.
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group