Hi Guys,
We have a pretty large app that relies on many of your components. We have become aware of Memory leaks in our products that over time crash the application. Every time we try to track down where they are coming from it always ends up being in the unmannaged memory that ties to your objects.
One of the problems we have is with the Telerik RadGridView. We store a lot of data into these grid views and when the user clears the data in the grid views we expect the memory to be free'd up and not to keep stacking.
I went ahead and made a sample application to show you guys. All i'm doing is adding rows to the grid via a ObservalbleCollection<string> bound to the ItemSource and then clearing that ObservableCollection. In this sample application however if I clear multiple times it does in fact release the memory. I'm not sure why it would take multiple clear calls especially since I am calling GC.Collect() and GC.WaitForPendingFinalizers in the clear function for testing.
In our actual application that memory never disposes and ramps up every time we load new data until we run out of memory and I will do my best to reproduce this in another sample program.
In our actual application that memory never disposes and ramps up every time we load new data until we run out of memory and I will do my best to reproduce this in another sample program.
We are updated to the newest Silverlight and Telerik versions.
Here is the xaml and code behind for the sample project.
MainPage.Xaml
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
x:Name="UserControlCodeSummary"
x:Class="SilverlightApplication1.MainPage"
d:DesignHeight="317"
d:DesignWidth="1082">
<StackPanel>
<Button
Height="18"
Name="AddData"
Click="Add_Data_Click"
Content="Add Data"
>
</Button>
<Button
Height="18"
Name="ClearData"
Click="Clear_Click"
Content="Clear Data"
>
</Button>
<telerik:RadGridView
x:Name="DatagridHCPCS"
EnableColumnVirtualization="False"
EnableRowVirtualization="False">
</telerik:RadGridView>
</StackPanel>
</UserControl>
MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Collections.ObjectModel;
using Telerik.Windows;
using Telerik.Windows.Data;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
private ObservableCollection<string> itemSource = new ObservableCollection<string>();
public MainPage()
{
InitializeComponent();
this.DatagridHCPCS.ItemsSource = itemSource;
}
private void Add_Data_Click(object sender, RoutedEventArgs e)
{
for (int i = 0; i < 15; i++)
{
itemSource.Add("123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789");
}
}
private void Clear_Click(object sender, RoutedEventArgs e)
{
itemSource.Clear();
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
}
We have a pretty large app that relies on many of your components. We have become aware of Memory leaks in our products that over time crash the application. Every time we try to track down where they are coming from it always ends up being in the unmannaged memory that ties to your objects.
One of the problems we have is with the Telerik RadGridView. We store a lot of data into these grid views and when the user clears the data in the grid views we expect the memory to be free'd up and not to keep stacking.
I went ahead and made a sample application to show you guys. All i'm doing is adding rows to the grid via a ObservalbleCollection<string> bound to the ItemSource and then clearing that ObservableCollection. In this sample application however if I clear multiple times it does in fact release the memory. I'm not sure why it would take multiple clear calls especially since I am calling GC.Collect() and GC.WaitForPendingFinalizers in the clear function for testing.
In our actual application that memory never disposes and ramps up every time we load new data until we run out of memory and I will do my best to reproduce this in another sample program.
In our actual application that memory never disposes and ramps up every time we load new data until we run out of memory and I will do my best to reproduce this in another sample program.
We are updated to the newest Silverlight and Telerik versions.
Here is the xaml and code behind for the sample project.
MainPage.Xaml
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
x:Name="UserControlCodeSummary"
x:Class="SilverlightApplication1.MainPage"
d:DesignHeight="317"
d:DesignWidth="1082">
<StackPanel>
<Button
Height="18"
Name="AddData"
Click="Add_Data_Click"
Content="Add Data"
>
</Button>
<Button
Height="18"
Name="ClearData"
Click="Clear_Click"
Content="Clear Data"
>
</Button>
<telerik:RadGridView
x:Name="DatagridHCPCS"
EnableColumnVirtualization="False"
EnableRowVirtualization="False">
</telerik:RadGridView>
</StackPanel>
</UserControl>
MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Collections.ObjectModel;
using Telerik.Windows;
using Telerik.Windows.Data;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
namespace SilverlightApplication1
{
public partial class MainPage : UserControl
{
private ObservableCollection<string> itemSource = new ObservableCollection<string>();
public MainPage()
{
InitializeComponent();
this.DatagridHCPCS.ItemsSource = itemSource;
}
private void Add_Data_Click(object sender, RoutedEventArgs e)
{
for (int i = 0; i < 15; i++)
{
itemSource.Add("123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789");
}
}
private void Clear_Click(object sender, RoutedEventArgs e)
{
itemSource.Clear();
GC.Collect();
GC.WaitForPendingFinalizers();
}
}
}