Our application is a 32-bit application which we normally run on computers configured with 4 GB of RAM. This allows the application to use approximately 1.4-1.5 GB of RAM before it gets a OutOfMemory exception. I have also configured the machine and set the application to use "/LARGEADDRESSAWARE flag which allows the application to continue running until it reaches 2.0 GB of RAM.
We are trying to plot some rather large grids using the Isoline features in MapSuite. It is plotting okay until we reach grid sizes nearing 2000 x 2000. We have one grid that fails because the application received an OutOfMemory exception. The grid size on this plot is 1727 x 2255 which is slightly less than 4,000,000 cells. The grid has a large quantity of "NoDataValue" cells which are being filled with the Value I have defined as "NoDataValue". I am bypassing the code which generates the isolines using either GridIsoLineLayer or InMemoryGridIsoLineLayer . All the code is generateing is the GridFeatureLayer from the GridFile (to display shading between the isolines).
I am able to generate the GridFeatureLayer with around 5 ClassBreaks defined. After the layer is generated my memory usage is around 0.9 GB. The application then attempts to display the layer by calling the winformsMap1.Refresh. Initially, the memory usage drops to around 0.5 GB but then quickly (in a few minutes) climbs to 1.4 GB at which time it throws an OutOfMemory exception. I am catching the exception but it will repeat everytime the winformMap1.Refresh is called until I remove the GridFeatureLayer from the map overlays.
We will be building our application as a 64-bit app at some time in the future which should alleviate this issue but in the meantime is there anything that can be done to use paging or some other memory management to avoid the OutOfMemory exception. Why does the refresh require so much memory when the GridFeatureLayer has already been created?
Thanks for any input or suggestions.
Richard