Hi!
I have a question : If i load in a ultragrid a big big datatable (using SetDataBinding) so that it takes about 1gb RAM, and after that i dispose the datatable and bind the grid to another datatable, a much smaller one - why doesn't the grid autmoatically decrease the used ram - it remains as big as for the first datatable.
How are you checking the RAM?
It's possible that the memory is no longer in use, but it simply has not been garbage-collected, yet.
You can test that like so:
GC.Collect();
GC.WaitForPendingFinalizers();
If the memory does not get freed up after that, then something is wrong. It is, of course, possible that something in your application is holding on to these objects. But it could also be a bug in the grid. We just fixed a couple of memory leak issues in the grid and those fixes will be available in the January service release.
Are you doing anything to the grid in the sample you describe here? Are you editing a cell, for example? Or does this happen just by setting the DataSource on the grid, clearing it, and setting it again?
Thanks for your answer Mike!
Well all i'm doing is to set the grid data binding and after that reset it to another , smaller, source.
Did you try invoking the garbage collector with the code I posted above? I'm curious to see if that helps.
If it does not, then you can either wait for the service release and see if that fixes it, or post a small sample project which demonstrates the issue here and I will check it out.
Hi Mike!
Yes, I've tried but it makes no change in the memory use. I went for the easy solution, and limited the number of rows in the grid.
Hello,
Please let us know if you have any other questions.