Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
How to reduce memory usage when binding to a large table
posted

Hi,

I have a WinGrid that data blind to a table that contain more than 40,000 rows.  However, not all rows need to be displayed. I added a filter so that it only display about 10 to 20 rows.

However, even thou I added a filter, the amount of memory that the grid uses is still very high ~ 700MB.

My WinGrid bounds to a DataSet which is the main repository in memory.  Since WinGrid filtering doesn't seem to affect memory usage, I created a temporary DataSet, and only loaded the data that needed to be displayed. This definitely reduce the amount of memory usage. However, I still prefer to have the WinGrid bounds to the original DataSet, because all the operation is done on that dataset and not the temporary one.

If I have to apply my temporary DataSet solution, I would have to add many code to synchronize the main DataSet and temporary DataSet.

Is there other way to reduce memory usage for WinGrid that bound to a large table. I am guessing the reason why the memory usage is high because of the number of WinGrid Cell elements generated. Is it possible to have the WinGrid generate the cells dynamically, instead of keeping all the cell data in memory?

Another alternative to reduce memory usage due to large data table?