ThinkGeo.com    |     Documentation    |     Premium Support

System.OutOfMemoryException

I generated today a System.OutOfMemoryException today when panning and zooming a map. I am using 10 or so WFS Layers, all GeoCached. Application memory usage at the time was only 570MB. I am running with 4GB.


I am utilizing a TileCache of SessionFileBitmap. This problem seems to be revolving around drawing a large amount of features from various WFSFeatureSource that are cache'd in memory. Is there no way to avoid this error by somehow utilizing the System paging file? I thought that was the purpose of the paging file was incase there was a lack of free memory, even though my system reads having over 1.5GB free.


My StackTrack is as follows:


 


"Exception of type 'System.OutOfMemoryException' was thrown."


 


"   at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity)\r\n   at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength)\r\n   at System.Text.StringBuilder.Append(Char[] value, Int32 startIndex, Int32 charCount)\r\n   at System.IO.StreamReader.ReadToEnd()\r\n   at ThinkGeo.MapSuite.Core.WfsFeatureSource.RequestStreamWithEvents(String requestString)\r\n   at ThinkGeo.MapSuite.Core.WfsFeatureSource.x0717b45e9da85c72(RectangleShape x05576ac689f0c0df, IEnumerable`1 x8ad42fcdfcf2a001)\r\n   at ThinkGeo.MapSuite.Core.WfsFeatureSource.GetFeaturesInsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable`1 returningColumnNames)\r\n   at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawingCore(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)\r\n   at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesForDrawing(RectangleShape boundingBox, Double screenWidth, Double screenHeight, IEnumerable`1 returningColumnNames)\r\n   at ThinkGeo.MapSuite.Core.FeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)\r\n   at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)\r\n   at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)\r\n   at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x03e3d48bcfe7bb6c(IEnumerable`1 xa6f0db4f183189f1)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xff5b27c00f9678c2(RectangleShape x178b193eec228e6e)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xe3cee4adb9c72451(Int32 xb565f4681f05557a)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xc8fbf8304fe7558e(InteractionArguments x195facd4ef5d753d)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xfeca3317d3c75bbb(Object xd9272088e65bd176, x6a8380ab1a7ebb4c xc2fd4c0ed406cdb7)\r\n   at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.OnMouseEvent(x6a8380ab1a7ebb4c e)\r\n   at ThinkGeo.MapSuite.DesktopEdition.x5cd462d41be2f68a.AnalyseMouseWheel(Double screenX, Double screenY, Double worldX, Double worldY, Int32 delta)\r\n   at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xb0cb8571d4771126(Object xd9272088e65bd176, MouseEventArgs xc2fd4c0ed406cdb7)\r\n   at System.Windows.Forms.MouseEventHandler.Invoke(Object sender, MouseEventArgs e)\r\n   at System.Windows.Forms.Control.OnMouseWheel(MouseEventArgs e)\r\n   at System.Windows.Forms.Control.WmMouseWheel(Message& m)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.Run(ApplicationContext context)\r\n   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n   at GeoTMSMapViewer.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81\r\n   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()"


 



 


Nelson,
 
Thanks for your reporting, probably we found the reason and will try to fix it, while it is very difficult to test your case without your 10 WFS servers:).
 
Please respond back to keep this thread alive.
 
Thanks.
 
Yale

I know it is a very difficult scenario to have to trouble shoot so thank you for the efforts.

Nelson


This problem is expected be fixed in version (3.0.431), if you want, you could contact our support for an update version.
 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale