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.
Crystal.
Hi Mike
Sorry to say this is not as you are saying. We are using 7.3 in our application. When we close or dispose form. We have to dispose ultragid, its appearance and everything relevant to it which we are using. Otherwise the footprint of Virtual memory does not come down. I do not know why have i to dispose everything of Ultragrid and same for other controls. Ultratoolbar manager, Ultratab etc
Regards
Asad Naeem
qhbyjh said: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.
If you are setting the DataSource on the grid to a new DataSource and some kind of leak is occurring, then that's a problem. But without knowing exactly what is leaking, I'm not really prepared to guess what the issue is. It could be something in your code, like the UltraCheckEditors you mentioned previously, or it's possible this is a bug in the grid, or maybe in DotNet's binding.
Hi Crystal,
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.
Hi Mike,
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.
Thanks,
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?