We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Memory consumption general

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. Thanks, Jan

3 Replies

AD Administrator Syncfusion Team August 18, 2003 02:16 PM UTC

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?

SG Sean Greer August 18, 2003 02:36 PM UTC

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.

JH Jan Hornych August 19, 2003 03:44 AM UTC

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. Jan

Live Chat Icon For mobile
Up arrow icon