Red Gate forums :: View topic - Generic Lists and GCAlloc.Handle
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

Generic Lists and GCAlloc.Handle

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



Joined: 26 Nov 2010
Posts: 3

PostPosted: Fri Nov 26, 2010 6:25 pm    Post subject: Generic Lists and GCAlloc.Handle Reply with quote

In my Silverlight application I've got some member properties of Controls that are generic lists. For some reason when the Control is destroyed these are left behind as array structures referenced by a System.Object[] which has been GCHandle.Alloc'ed. Is this behavior correct, or is there something up with my app?[/img]
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Mon Nov 29, 2010 12:44 pm    Post subject: Reply with quote

Static variable storage is implemented internally by .NET as object arrays referenced by GC handles. ANTS usually tries to decode which static variables are actually referencing the objects but can't always successfully resolve the values of all the variables due to the way the profiling API works.

Objects that can be 'interned', such as strings, will also end up in a similar object array, so this pattern doesn't always indicate a static variable.

However, it's most likely that this is what has happened here: there's a static variable somewhere that is referencing your class, but ANTS has been unable to resolve its name.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
woodced



Joined: 26 Nov 2010
Posts: 3

PostPosted: Mon Nov 29, 2010 4:54 pm    Post subject: Reply with quote

Interesting. I can't see why I'd have a static reference to this, but I'd need to look into it further.

Under what circumstances is ANTS not able to decode the static variable reference? Is there any way of avoiding this circumstance?
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