We use UltraDataSource as UltraGrid DataSource. There is a hidden column containing our domain object in the grid. Every time when there is a need to refresh grid with latest collection, we set the old DataSource to null and assign a new UltraDataSource to the grid. It's faster this way than refresh each row. But it seems old domain object collection was not released after refresh. This caused memory leak issue in our app, since we need to refresh our grid often.
Any suggestion on this is much appreciated.
Forget to mention that it looks like the reason why domain object didn't get released is that UltraGrid has reference to them.
Do you have the latest service release? If not, you should try that and see if it helps.
How to get the latest service release - Infragistics Community
If that does not help, we will need a sample sample project demonstrating the problem so we can check it out.
We found out it's UltraCheckEditor that caused the memory leak. We need to align checkbox in a column to the top. We use UltraCheckEditor as editor control. After we replaced with CheckEditor, everything's fine, no more memory leak.
Do you know when we should use UltraCheckEditor? Is there a way to release manually release UltraCheckEditor control?
When there is a need to refresh grid with latest collection, we set the old DataSource to null and assign a new UltraDataSource to the grid. I found out recently it's quite expense to set old DataSource to null, then assign with a new UltraDataSource, since set method in DataSource property are called twice.
What's the propery way to release old UltraDataSource object, I tried not to set old datasource to null, just assign with new UltraDataSource object. Memory Profiler will give memory leak warning.
qhbyjh said:Do you know when we should use UltraCheckEditor? Is there a way to release manually release UltraCheckEditor control?
This probably has nothing to do with the grid. If you create a control, then you are responsible for disposing of it. If you create a control at design-time and put it on the form, then the form very nicely handles this for you as a convenience. When the form is disposed, it disposes the controls in it's Controls collection.
My guess is that you were creating the UltraCheckEditor controls in code and so they were never added to the Controls collection of the form and you never disposed them.