I'm having an issue where, when I have several .tpk files loaded into layers (maybe 10 or 12, ~8 gigs) and maybe 50-100 graphics of various kinds in 3D, I get a crash from the runtime.
I've noticed that this doesn't happen when I don't have any graphics, but if there are graphics and several TPK layers, when I switch to that view, I get a crash. Oddly it sometimes seem to happen more easily when more zoomed-in, I'm not sure why.
This is a problem because the error comes up from C++ in an asynchronous way and thus I don't know of a way to catch it, it just kills my application every time. The error is:
Esri.ArcGISRuntime.ArcGISRuntimeException: 'Internal error exception. Buffer_loader_cache::map_buffer ERROR, cannot create staging resource!: c:\daily_r\rtc\runtimecore\c_api\src\mapping\map_view\geo_view.cpp (209) : error : Exception caught in RT_GeoView_pulse'
This isn't related to available RAM, I have plenty. One thing that seems to trigger it relatively easily is a wide view -- let's say all my maps and data are in Florida. If my 3D map starts very zoomed-out over Africa, then I drag the map around so that the TPKs and Graphics come into view at the same time, it'll crash and give me this error. I'm assuming it has something to do with allocating Graphics and map data at the same time.
I can cause this error consistently, but it doesn't seem to happen if there are lots of TPKs, but not very many or no Graphics. That makes me wonder if it has to do with allocating storage for both kinds of things simultaneously.
My application starts with a 2D map, with the 3D SceneView control loaded in memory but not attached to the current visual tree (it's in a Prism region). When I switch from 2D to 3D (using Prism navigation to swap out the 2D control for the 3D control), then navigate to where my data is, I'll frequently get the above crash. So it may have something to do with how WPF is trying to manage the SceneView's resources as it gets removed and re-added to the visual tree, as well.
Right now the only mitigation I have for this problem is to, by convention, limit the number of TPK files I have loaded at any given time, since with a small number of TPKs I don't see this issue. It's difficult to tell end users they can't load too many map files, though, so some kind of way to solve this problem would be appreciated.