Select to view content in your preferred language

Application crashes with out of memory error after long sessions

04-21-2021 12:06 PM
New Contributor

We are using ESRI.ArcGISRuntime.WPF 100.8 in an application that sits in a dispatch center and shows the locations of all vehicles. This application is supposed to run 24/7 however 2 of the 21 dispatch centers where our app is running have reported that app crashing once or twice a month with a widows error.

Every function in the application is wrapped in a try catch block that writes to a log file. Prior to the crash we get the following exceptions a few thousand times in the log:

03/15 21:55:39 <ProcessMobiles>d__82.MoveNext : bad allocation:
c:\dev_r\rtc\runtimecore\c_api\src\mapping\map_view\graphic.cpp(640) : error : Exception caught in RT_Graphic_setIsVisible

03/27 23:40:53 <SetMobileGraphic>d__23.MoveNext : bad allocation:
c:\dev_r\rtc\runtimecore\c_api\src\vector.cpp(599) : error : Exception caught in RT_Vector_removeAll

03/27 23:40:53 EsriViewModel.ProcessMobiles : bad allocation:
c:\dev_r\rtc\runtimecore\c_api\src\mapping\map_view\graphic.cpp(640) :

ProcessMobiles, SetMobileGraphic, are out functions but vector.cpp(599) and graphic.cpp(640)  seem to be ESRI files.

No other exceptions are thrown from the application.

The exceptions log over the span of 8 to 12 hours from when the first exception is thrown until the apps inevitable crash. The app can run for days without throwing the first exception, but once it starts it inevitably crashes in that 8 to 12 hour window.

When viewing the application in Task manager there is a slow increase in the amount of memory it uses, depending on external activity it can go up by 100K in a few minutes to a few hours, but the memory footprint is always expanding.

Viewing the app on a development computer with the memory performance profiler indicates the fastest growing part of the application is the WeakReference->BindingExpression->BiningExpressing [Cycle Detected]. I don’t know what this means.


0 Kudos
1 Reply
New Contributor III

Binding expressions would be part of WPF itself, and not part of the ArcGIS Runtime. I'm guessing there's something in your codepath that ultimately is holding on to things, and preventing these from getting collected. The memory performance profiler and windbg should be able to help you pinpoint what that is. Bindings aren't use by ArcGIS Runtime at all (only template bindings), so most likely caused by user code.

0 Kudos