GraphicsOverlay Remove Item Randomly Leads To UI Freeze

1704
2
05-20-2021 03:03 AM
ofir_bar_tal
New Contributor

In my project I uses the Esri.ArcGIS.Runtime toolkit for .NET application development. (WPF)

I am using this toolkit for about 2 years now, and recently encountered some kind of unexplained bug.
while using the MapView.GraphicsOverlay[key].Graphics.Remove(itemToRemove) the program freezes.

In my application the map interaction frequency is about 100Hz. (Add/Remove points to GraphicsOverlay)

This happens randomly , and when debugging I have found that the program gets stuck while executing these lines:

public void Remove(long position)
{
    IntPtr errorHandle;
    CoreVector.CoreRT_vector_remove(this, position, out errorHandle);
    GC.KeepAlive(this); <--
    
InteropCheckError(errorHandle, true, default(GCHandle));
}

since map updates are executed from the main UI thread, it makes the whole program freeze.
and windows 10 labels the program as unresponsive.

can anyone point me to a solution? has anyone encountered this issue before?
Thanks

2 Replies
almogelmaliah
New Contributor

I'm having the same issue, would appreciate any help :)

0 Kudos
MatveiStefarov
Esri Contributor

Hello! I've been trying to debug this problem, but so far I have not been able to reproduce the freeze.  Could you help me narrow down this problem by answering a few questions?

  • Which version of ArcGIS Runtime are you using?
  • What GraphicsRenderingMode is used on the overlay -- static or dynamic?
  • What geometry type do the Graphics have (point, line, polygon, etc)?
  • Are there any other tasks happening in the background around the time of the freeze (e.g. identify operations, adding/removing layers, changing symbology, resizing the view, etc)?
0 Kudos