Hi Ben
Thanks for your explanation.
You wrote: “the GC cannot keep up with releasing the underlying WaitHandle objects”
I do no understand what you mean. Do you mean that it is a bug in .NET ?
Note that in our cases the application was running for 2~3 days and the handle count was over 10000 where 9000 alone was of kind “Event Handler” (from Sysinternals Handle tool).
About replacing LayerOverlay with FeatureLayerWpfDrawingOverlay it is my understanding that it is not possible for me to replace LayerOverlay with FeatureLayerWpfDrawingOverlay for all the cases
Our application uses 6 overlays both because it is requested by the API and also in order to hide/show or refresh a single overlay:
- An overlay for moving devices
- An overlay for (semi) static devices like base stations
- An overlay for geofencing areas
- An overlay ESRI Shapefiles
- An overlay for the Graticule Grid
- An overlay for the base map (Raster, OpenStreetMaps, WMS, …)
At the moment cases 1 to 3 are now using FeatureLayerWpfDrawingOverlay as you suggested. But this is not possible in cases 4 to 6.
OpenStreet maps and WMS maps use their own overlay: WmsOverlay and OpenStreetMapOverlay.
Raster maps (ECW and GeoTiff) are loaded using a GdalRasterLayer and they are added to a LayerOverlay. It is not possible to use FeatureLayerWpfDrawingOverlay in this case.
GraticuleFeatureLayer is raising an exception when used with FeatureLayerWpfDrawingOverlay therefore I am still using LayerOverlay: System.ArgumentOutOfRangeException: The input double value is out of range. (Parameter ‘distance’)
ShapeFileFeatureLayer is also raising an exception when used with FeatureLayerWpfDrawingOverlay therefore I am still using LayerOverlay: The FeatureSource is not open. Please call the Open method before calling this method.
We have just terminated the migration from version 14.6.2 to 14.3.2 and we have performed some quick test in order to check if we cover the previous functionality. We will start long run and handle count test now, but it is my impression that the handle count is still increasing.
I will start 3 long run tests in parallel:
- Our application with the map view open
- Our application without the map view open
- The demo application (the source code is in this thread)
I will collect the handle count on all the 3 cases, and I will report the result in this thread
One last comment. We have observed this in the demo for the case: Map is delaying the process to close - ThinkGeo UI for Desktop / WPF - ThinkGeo Discussion Forums
This entry could be related to this one. We have observed very often that when the application terminates (with a long delay) the last line in Visual Studio Output Window is:
The program ‘[33604] DemoMapStealingFocus.exe’ has exited with code 3221225477 (0xc0000005) ‘Access violation’.
This is also reported in that thread
Best regards
Domenico