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

Memory Leak Problems

5 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Jamie asked on 06 Feb 2012, 03:37 PM
We're evaluating the RadControls for use in our software, but are running into a bit of a brick wall with GridView. Our software allows the user to click items, then display data about them in the GridView. Each item that is chosen must refresh the grid, add new columns and rows, because the number of each required can vary. Every time the ItemsSource of the GridView is set, the memory used by the program shoots up 10meg or more, even though there are only a few rows being loaded in. 

Any thoughts? The controls in general seem good, but this is unfortunately a deal breaker if we can't get it to work...

We're running .NET 4.0 (C#), Win 7, 2011 Q3 RadControls Trial

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Feb 2012, 03:43 PM
Hi,

 Can you post more info about your scenario? Any grid settings? Data-binding? 

All the best,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Jamie
Top achievements
Rank 1
answered on 06 Feb 2012, 03:53 PM
Sure. We're using a custom style, but when I set the grid to use the default style, the issue remains. The grid's using a number of groups and frozen columns. Virtualisation is on. Again though, I've removed each of these and the problem remains.

The core of it is a DataTable, generated every time an item is requested, which is set as ItemsSource. 

This is our xaml:               
<telerik:RadGridView x:Name="StockGrid" Background="WhiteSmoke" CanUserFreezeColumns="True" RowIndicatorVisibility="Collapsed" IsSynchronizedWithCurrentItem="False" CanUserSelect="True" SelectionMode="Extended" SelectionUnit="Cell" GridLinesVisibility="Both"/>

It seems to still occur even when the only C# reference to the table is

StockGrid.ItemSource = ourDataTable;

When this line is commented out, there's no leak, but obviously nothing shown on screen either. It's like whenever the new data is assigned to the table, the previous data remains in memory instead of being garbage collected.
0
Vlad
Telerik team
answered on 06 Feb 2012, 03:57 PM
Hello,

 Can you verify if the grid is not measured with infinity height (inside StackPanel, ScrollViewer, etc.)? What's the situation with standard WPF DataGrid in your scenario? 

Greetings,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Jamie
Top achievements
Rank 1
answered on 06 Feb 2012, 04:06 PM
Just inside a few grids. I tested them with defined heights and widths, doesn't seem to make a difference. It is in a column of defined width, if that could make a difference. The standard DataGrid doesn't leak in the exact same position, but we really would prefer the RadControls grid for the advanced grouping/filtering etc.
0
Vlad
Telerik team
answered on 06 Feb 2012, 04:09 PM
Hi,

 Please send us the project (via support ticket) to check it locally what's going on.

Kind regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Jamie
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Jamie
Top achievements
Rank 1
Share this question
or