When I add an empty GridControl to my form, memory usage of my application increases by about 9MB compared to the same form without grid. What is causing it ? Is there a way to switch off usage of some internal data container in the grid ? I provide data to the grid only dynamically by events, I would expect some memory savings at the GridControl itself.
ADAdministrator Syncfusion Team August 18, 2003 09:16 AM
The first time a grid is loaded, the Grid and Shared assemblies are loaded as well. But this normally is about .5Meg, not 9Meg. The attached sample illustrates this.
Are you explicilty setting grid.RowCount = some value? If so, then this potentially allocates storage. In a 'perfect' virtual grid, you would not do this, but instead dynamically provide the row and column counts through QueryColCount and QueryRowCount events.
Can you explain a little more about what you are doing, or see the problem in the sample?
SGSean GreerAugust 18, 2003 09:36 AM
If you're looking at the "Mem Usage" column in the Task Manager's Processes tab, the value that you're seeing is the working set size of the application. This represents the reserved memory, not the committed. Essentially when the grid is loaded a number of DLLs are loaded and the OS reserves enough memory for the code and data pages of the DLLs.
If you minimize the application and then restore it, you'll see that the working set is reduced. This is because the OS trims the working set of the process to reduce the amount of reserved memory. You can do this as well by P/Invoke'ing SetProcessWorkingSetSize.
To get a better idea of the actual memory your application is using you might want to take a look at the Memory:Private Bytes performance counter.
JHJan HornychAugust 18, 2003 10:44 PM
Clay, your example is behaving exactly as mine, about 10MB increase when opening the grid.
... and the memory values follow Sean's description.
This explanation is good enough for me, thanks for clearing it up.