This is a migrated thread and some comments may be shown as answers.

Memory leak when repeatedly auto-hiding then docking ToolWindow in RadDock with data-binding

4 Answers 100 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Eljay
Top achievements
Rank 1
Eljay asked on 18 Jan 2012, 06:54 PM
Hey Telerik,

I've discovered a memory leak issue when repeatedly auto-hiding then docking a ToolWindow in a RadDock.

I'm designing an application using the MVVM design pattern with a basic View and View-Model. The View is a form that contains a RadDock with a ToolWindow, and data-binding setup to the ToolWindow's property "DockState." The View-Model contains the bound property "ToolWindow1DockState" that uses INotifyPropertyChanged to update the ToolWindow's property "DockState". Below is my code, attached is my View's designer.

View
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RadDockMemoryTest.ViewModel;
 
namespace RadDockMemoryTest.View
{
    public partial class Form1 : Form
    {
        private MainViewModel viewModel;
        /// <summary>
        /// View Model object
        /// </summary>
        public MainViewModel ViewModel
        {
            get
            {
                if (viewModel == null)
                {
                    ViewModel = new MainViewModel();
                }
                return viewModel;
            }
            set { viewModel = value; }
        }
         
        /// <summary>
        /// Form default constructor
        /// </summary>
        public Form1()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// Form load event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, EventArgs e)
        {
            setupControlBindings();
        }
 
        /// <summary>
        /// Setup window's control bindings
        /// </summary>
        private void setupControlBindings()
        {
            radDock1.DockWindows["toolWindow1"].DataBindings.Add("DockState", ViewModel, "ToolWindow1DockState", true, DataSourceUpdateMode.Never);
        }
    }
}

ViewModel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.WinControls.UI.Docking;
 
namespace RadDockMemoryTest.ViewModel
{
    public class MainViewModel : ViewModelBase
    {
        private DockState toolWindow1DockState;
        /// <summary>
        /// Controls toolWindow1's dock state
        /// </summary>
        public DockState ToolWindow1DockState
        {
            get { return toolWindow1DockState; }
            set
            {
                toolWindow1DockState = value;
                OnPropertyChanged("ToolWindow1DockState");
            }
        }
    }
}

I setup a Window's automation tool to execute the following sequence:
1. Click "Auto-hide" on the docked ToolWindow.
2. Click the ToolWindow tab.
3. Click "Docked" to restore the ToolWindow to its docked state.

After letting the automation run overnight and observing memory processes in Windows Task Manager, I noticed the application's memory usage jumped from 32,000KB to 800,000KB.

How can I avoid the memory leak?

Thanks,
Eljay

4 Answers, 1 is accepted

Sort by
0
Eljay
Top achievements
Rank 1
answered on 18 Jan 2012, 06:58 PM
I forgot to add that when the application hit 800,000KB, minimizing the application caused it to crash.
0
Jack
Telerik team
answered on 20 Jan 2012, 06:16 PM
Hi Eljay,

Thank you for reporting this issue. In our latest release - Q3 2011 SP1 we addressed several issues related with memory leaks including one related with RadDock. Our tests do not indicate further memory leaks in RadDock. We always take serious such issues and that is why we want to investigate this one further. Could you, please send us your test application. This will help us to locate any potential issue faster and to ensure that this issue will be addressed in our upcoming release in February. Thank you in advance.

I am looking forward to your reply.

Regards,
Jack
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

0
Eljay
Top achievements
Rank 1
answered on 20 Jan 2012, 06:22 PM
Hey Jack,

I'm running RadControls for WinForms Q3 2011 SP1. How can I send my application to Telerik?

Thanks,
Eljay
0
Eljay
Top achievements
Rank 1
answered on 20 Jan 2012, 06:26 PM
Ignore my latest post. I entered a support ticket with a .zip file attached containing my application.

http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=503696
Tags
General Discussions
Asked by
Eljay
Top achievements
Rank 1
Answers by
Eljay
Top achievements
Rank 1
Jack
Telerik team
Share this question
or