ThinkGeo.com    |     Documentation    |     Premium Support

Running out of memory when using LayerOverlay

We are using a LayerOverlay during the load when you open the map to load flyover images if they exist.
What we are running into if these maps are used for long periods of time (2-4 hours) they will throw an OutOfMemory Exception error. Is there any known way to handle this?

Hi Jayce,

For out of memory exception, it maybe caused by many reasons, so could you please upload a sample which can reproduce it.

And please notice when the application keep runs, whether the memory keep increase, we want to know whether it’s a memory leak.

Regards,

Don

If aryFi.Count > 0 Then
If Not MapSetupOptionBo.MapLoadGeoMulit Or UseBackgroundMapBing Then
Dim fi As FileInfo
For Each fi In aryFi
Dim ImageLayer As MrSidRasterLayer = New MrSidRasterLayer(fi.FullName)
ImageLayer.Open()
LexusMap.CurrentExtent = ImageLayer.GetBoundingBox()
ImageLayer.Close()
ImageLayer.Transparency = loImagetrans
If UseBackgroundMapBing Then
ImageLayer.ImageSource.Projection = Projection_ConvertRasterToGoole
End If
OverlayImage.Layers.Add(fi.FullName, ImageLayer)
Next
Else
If Not File.Exists(MapSetupOptionBo.MapSetFlyOverDir.Trim & “\referenceFile.txt”) And MapSetupOptionBo.MapLoadGeoMulit Then
MultiGeoRasterLayer.BuildReferenceFile(MapSetupOptionBo.MapSetFlyOverDir.Trim & “\referenceFile.txt”, MapSetupOptionBo.MapSetFlyOverDir.Trim, filetype)
End If
Dim multiGeoRasterLayer__1 As New MultiGeoRasterLayer(MapSetupOptionBo.MapSetFlyOverDir.Trim & “\referenceFile.txt”)
OverlayImage.Layers.Add(“MuiltGeo”, multiGeoRasterLayer__1)
End If
End If

From what I have noticed, the memory is continuing to increase while the application is open. Only when the map has the flyovers loaded.

Hi Jayce,

From your code, it looks you load multiply MrSid layer, when our map load the data like MrSid sometimes it is via 3rd part dll package, not all of them is managed code. I guess maybe in some special situation it touch the memory limitation.

I don’t know your dll version, but if you are not using the latest version, could you please update your dlls to our latest V10 because we did many enhancement in the past years, so maybe the latest version had solved your problem.

You can learn more guide from our wiki.

And you mentioned the memory keep increase when it “has the flyovers loaded”, does your flyovers saved in some special data not the same as other area?

For further research on this issue, could you please upload a simple sample with your test data so our developer can go on work on it.

Regards,

Don