RadDropDownButton is leaking memory

7 posts, 0 answers
  1. Simon Störmer
    Simon Störmer avatar
    33 posts
    Member since:
    Oct 2012

    Posted 04 Jun 2010 Link to this post

    Hi Folks,

    i have created a simple UserControl called MyControl containing the code from your RadDropDownButton Demo:

    <UserControl> 
    <Grid> 
    <telerik:RadDropDownButton x:Name="MenuDropDown" Padding="5" Grid.Row="3" Width="187" VerticalAlignment="Center" Content="Menu">  
                <telerik:RadDropDownButton.DropDownContent> 
                    <telerikNavigation:RadContextMenu Width="180" BorderThickness="0">  
                        <telerikNavigation:RadMenuItem Header="Rotate right 90&#x0B0;">  
                        </telerikNavigation:RadMenuItem> 
                        <telerikNavigation:RadMenuItem Header="Rotate left 90&#x0B0;">  
                        </telerikNavigation:RadMenuItem> 
                        <telerikNavigation:RadMenuItem Header="Rotate 180&#x0B0;" > 
                        </telerikNavigation:RadMenuItem> 
                        <telerikNavigation:RadMenuItem Header="Flip vertical">  
                        </telerikNavigation:RadMenuItem> 
                        <telerikNavigation:RadMenuItem Header="Flip horizontal" > 
                        </telerikNavigation:RadMenuItem> 
                    </telerikNavigation:RadContextMenu> 
                </telerik:RadDropDownButton.DropDownContent> 
            </telerik:RadDropDownButton> 
    </Grid> 
    </UserControl> 

    My root visual contains a button and a content presenter called content. Each time i press the button i run the following code:

    MyControl c = new MyControl();
    content.Content = c;

    So each time i press the button, the RadDropDownButton insisde my control is detached from the visual tree and should hence be removed by gc. But if i take a look with windbg (running !DumpHeap -type RadDropDownButton) I find that the instances stick araound in memory - even after a call to GC.Collect().

    The GCRoot output is:

    DOMAIN(02C57638):HANDLE(Pinned):6a712f8:Root:  057c4260(System.Object[])->
      047d8e9c(System.Collections.Generic.Dictionary`2[[System.IntPtr, mscorlib],[System.Object, mscorlib]])->
      04906880(System.Collections.Generic.Dictionary`2+Entry[[System.IntPtr, mscorlib],[System.Object, mscorlib]][])->
      048d3914(System.Windows.Controls.Grid)->
      048d3978(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      048d39c4(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      048d2eb8(System.Windows.Controls.Border)->
      048d387c(System.Collections.Generic.Dictionary`2[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]])->
      048d38c8(System.Collections.Generic.Dictionary`2+Entry[[MS.Internal.IManagedPeerBase, System.Windows],[System.Object, mscorlib]][])->
      048d3254(System.Windows.Controls.ContentPresenter)->
      048d34cc(System.Collections.Generic.Dictionary`2[[System.Windows.DependencyProperty, System.Windows],[System.Windows.EffectiveValueEntry, System.Windows]])->
      048d3518(System.Collections.Generic.Dictionary`2+Entry[[System.Windows.DependencyProperty, System.Windows],[System.Windows.EffectiveValueEntry, System.Windows]][])->
      048d3868(MS.Internal.ModifiedValue)->
      048d36c8(System.Windows.Data.BindingExpression)->
      048cdbcc(Telerik.Windows.Controls.RadDropDownButton)

    As I use the DropDownButton within a large UserControl, the whole thing is prevented from being collected. Do I missunderstand windbg or is this an issue on your side?

    Any help would be apprecitated!

    Thanks in advance,

    Tobias Richling.

     

     

     

  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 04 Jun 2010 Link to this post

    Hello Tobias Richling,

    We are aware of the issue - it is a problem in the SL framework. Hopefully soon an update will be available that will fix the issue. We have contacted MS about that.

    Best wishes,
    Valentin.Stoychev
    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. jonney xu
    jonney xu avatar
    1 posts
    Member since:
    May 2010

    Posted 25 Sep 2010 Link to this post

    Whether you guys have fixed this problem?
    I have the same problem about RadDropDownButton in our project.
  4. Miro Miroslavov
    Admin
    Miro Miroslavov avatar
    588 posts

    Posted 28 Sep 2010 Link to this post

    Hi jonney xu,

     Yes, the memory leak problems are fixed. You can download the latest SP2 release and give it try.
    Please let us know if you experience any problems or find any memory leaks.
    Thank you.

    Kind regards,
    Miro Miroslavov
    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
  5. Chris
    Chris avatar
    51 posts
    Member since:
    Sep 2010

    Posted 12 Jan 2011 Link to this post

    Hi,

    These problems still exists in Q3 (2010.3.1206.1040) unless I am mistaken. I have a RadDropDownButton being presented inside a RadWindow. The RadWindow is never garbage collected, regardless of how I try and clean up in the Closed event. If I remove the RadDropDownButton all is well:

    <telerikSchema:RadDropDownButton x:Name="ActionButtons" Grid.Row="0" AutoOpenDelay="0" HorizontalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="3,3,0,3" Height="16" Width="16" Padding="0">
                <telerikSchema:RadDropDownButton.DropDownContent>
                    <telerikSchema:RadContextMenu StaysOpen="False">
                        <telerikSchema:RadMenuItem Command="{Binding ViewModeCommand, Converter={StaticResource WeakCommandBindingConverter}}" CommandParameter="" Header="{Binding ViewMode, Converter={StaticResource ViewModeMenuConverter}}" IconTemplate="{StaticResource MenuIcon}" Icon="{Binding ViewMode, Converter={StaticResource ViewModeIconConverter}}" />
                    </telerikSchema:RadContextMenu>
                </telerikSchema:RadDropDownButton.DropDownContent>
            </telerikSchema:RadDropDownButton>

    Any help on this would be appreciated as I have spent a long time with WinDbg on this.

    The output from WinDbg matches Tobias' output from the original post.

    Kind Regards,
    Chris Newton
  6. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 17 Jan 2011 Link to this post

    Hi Tobias Richling,

    Please accept our apologies for the late reply, but we will need more time in order to investigate better this issue. We will write you back as soon as we have some results.

    All the best,
    Viktor Tsvetkov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  7. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 19 Jan 2011 Link to this post

    Hello Chris Newton,

    We tried to reproduce the problem, but were not able to. Could please examine the attached sample project and follow the steps: click 3-4 times on the Add button, then click GC collect and then see how many are the live instances after clicking the button Live. You will see that the windows are removed and collected. So could please modify this example, if we are missing something, so it satisfies your requirements?

    Kind regards,
    Viktor Tsvetkov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top