Hi,
I have a problem out of memory when I Zoom + or zoom .
I'm using a multigeorasterlayer for the rasters.I have more than 300 rasters.I put a lowerscale and a upperscale for the multirasterLayer.
Step 1 : I zoom but no rasters are displayed because the zoom is under the lowerscale.
The zone memory of my application is 238696 K (processus windows)
Step 2 : I did a zoom in and rasters are displayed and the memory is 430 780 k
Step3 : I zoom in ,zoom out and the memory of my application is higher and higher (747564 k)
Step 4 : etc .... and the memory can reach more than 1 178 000k
I did differents tests with the cache :
Test1 :
MultiGeoRasterLayerTIF rasterTIFLayer = new MultiGeoRasterLayerTIF(cc.NomCheminRaster);
rasterTIFLayer.LowerScale = cc.LowerScale;
rasterTIFLayer.UpperScale = cc.UpperScale;
if (nmOverlay.Contains(cc.NomOverlay) == false)
{
nmOverlay.Add(cc.NomOverlay);
LayerOverlay ovLy = new LayerOverlay();
ovLy.Name = cc.NomOverlay;
ovLy.Layers.Add(cc.NomLayer, rasterTIFLayer);
ovLy.TileCache = new FileBitmapTileCache(@"..\..\App_Data\layerOverlayDrawWithCacheRaster\\", "ManualCache");
Bitmap nativeImageRaster = new Bitmap((int)MapActif.ActualWidth, (int)MapActif.ActualHeight);
GdiPlusGeoCanvas geoCanvasRaster = new GdiPlusGeoCanvas();
geoCanvasRaster.BeginDrawing(nativeImageRaster, MapActif.CurrentExtent, MapActif.MapUnit);
ovLy.Draw(geoCanvasRaster);
geoCanvasRaster.EndDrawing();
ovLy.TileCache = null;
lstOverlay.Add(cc.NomOverlay + "_KEY", ovLy);
}
Test2 :
MultiGeoRasterLayerECW rasterECWLayer = new MultiGeoRasterLayerECW(cc.NomCheminRaster);
rasterECWLayer.LowerScale = cc.LowerScale;
rasterECWLayer.UpperScale = cc.UpperScale;
if (nmOverlay.Contains(cc.NomOverlay) == false)
{
nmOverlay.Add(cc.NomOverlay);
LayerOverlay ovLy = new LayerOverlay();
ovLy.Name = cc.NomOverlay;
ovLy.Layers.Add(cc.NomLayer, rasterECWLayer);
ovLy.TileCache = new FileBitmapTileCache(@"..\..\App_Data\layerOverlayDrawWithCacheRaster\\", "ManualCache");
ovLy.RenderMode = RenderMode.GdiPlus;
ovLy.TileType = TileType.HybridTile;
lstOverlay.Add(cc.NomOverlay + "_KEY", ovLy);
}
But the memory is still higher and higher.
I did the test with no rasters, I zoom in and I zoom out and in this case, the memory is acceptable , about 250000K
So the problem comes from the display / loading of the rasters. There is no free memory zone.
How can I resolve my problem ?
I think I don't use very well the cache but i'm not sure ... ?
Thank you for your help.
Regards
Steph.