Options

Generic Lists and GCAlloc.Handle

woodcedwoodced Posts: 5
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]

Comments

  • Options
    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.
  • Options
    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?
Sign In or Register to comment.