Memory Leak in RadColorPicker

6 posts, 0 answers
  1. Dan
    Dan avatar
    8 posts
    Member since:
    May 2009

    Posted 02 Sep 2010 Link to this post

    Using 2010.2.812.1040

    Simply placing (and making visible at some point) a RadColorPicker on a page causes the entire visual tree of controls to become pinned in memory.  No custom templates, no property settings or event handlers.

    From windbg:
    DOMAIN(0B745520):HANDLE(Pinned):26512f8:Root:  09f2de80(System.Object[])->
      08f8ad84(System.Collections.Generic.Dictionary`2[[System.IntPtr, mscorlib],[System.Object, mscorlib]])->
      0ae098a0(System.Collections.Generic.Dictionary`2+Entry[[System.IntPtr, mscorlib],[System.Object, mscorlib]][])->
      092292f0(System.Windows.Controls.Grid)->
      09229354(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      092293a0(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      092291f4(System.Windows.Controls.Border)->
      09229258(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      092292a4(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      09228020(Telerik.Windows.Controls.RadColorSelector)->
      092294c8(System.EventHandler)->
      091147f4(Telerik.Windows.Controls.RadColorPicker)


    For now, we can minize the issue by manually removing any RadColorPicker from our controls during Unloaded event.   Please advise when this issue is resolved.
  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 07 Sep 2010 Link to this post

    Hello Dan,

    Thank you for contacting us.
    We are aware of this issue and it has reasonable explanation. There is a popup in the ControlTemplate of the RadColorPicker, in this popup there are custom databound properties and this causes the leak, but this is problem in the framework. We are currently trying to workaround this problem and we hope that there will be fix as soon as possible. I have updated your Telerik account.

    Best wishes,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Dan
    Dan avatar
    8 posts
    Member since:
    May 2009

    Posted 07 Sep 2010 Link to this post

    As I understand the SL framework issue with templates, the pinning only occcurs when the template is defined inline in the page or usercontrol.  I have not seen any issue with the templates defined a theme or app level resource dictionary. 

    What do you mean by 'custom databound properties'    I found a issue in radmap where the informationlayer was attaching to a dependancyproperty's propertychanged event (attaching a instance level handler to the static DP) which caused the issue.   We use custom DP's on on our controls and refer to them in the style templates on a regular basis without a leak.  I am curious what extra circumstance applies here so that we can avoid it also.

    Regardless, it seemed like we had a similar problem with RadContextMenu which i have not written up -- assuming you're using the same popup logic i won't pursue if further.

    In both cases, I've added a custom behavior via an Attached DP on the Unloaded event of the parent of the radcolorpicker or radcontextmenu to effectively null all of its databound properties and remove it from the visual tree which has mostly mitigated the issue.


  5. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 07 Sep 2010 Link to this post

    Hello Dan,

    The problem occurs when the popup is placed in the ControlTemplate of another control and in the ContentPresenter of that popup exists custom DP that is template binded, as it is in the RadColorPicker.

    Kind regards,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Dan
    Dan avatar
    8 posts
    Member since:
    May 2009

    Posted 07 Sep 2010 Link to this post

    I see.  Perhaps the issue could be avoided using a relativesource binding; or otherwise have the control deal with the unloaded event and remove the bindings. 
  7. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 07 Sep 2010 Link to this post

    Hi Dan,

    We will investigate which is the most efficient approach and hopefully the fix will be available soon.

    Best wishes,
    Viktor Tsvetkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner