<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Memory leak updating graphic symbol - ArcGis Runtime .Net in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/memory-leak-updating-graphic-symbol-arcgis-runtime/m-p/427703#M5172</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;i'm working with ArcGis Runtime SDK for .Net v10.2.5.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I have an UDP socket listening and waiting for image data that fires a function executed on a different thread in background.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I want to draw the image over a ellipse of arbitrary radius so i use&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; var filestream = System.IO.File.Open(imagepath, FileMode.Open, FileAccess.Read);
 MapPoint point = new MapPoint(center.longitude, center.latitude, SpatialReferences.Wgs84);&amp;nbsp; 
 var polySymbol = new Esri.ArcGISRuntime.Symbology.PictureFillSymbol(); 
 await polySymbol.SetSourceAsync(filestream);&amp;nbsp; 
 var param = new GeodesicEllipseParameters(point, 25, LinearUnits.Meters); 
 var ellipse = GeometryEngine.GeodesicEllipse(param);&amp;nbsp; 

 ***//HERE IS THE PROBLEM*** 
 _graphicsLayer.Graphics.Clear(); 
 _graphicsLayer.Graphics.Add(new Graphic { Geometry = ellipse, Symbol = polySymbol }); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;This is done ~5 times/second. Despite i'm clearing the layer each iteration there is a memory leak that is increasing memory use till app crashes.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I read about problems with memory using ArcGIS and Geometry process, so i'm not sure if i'm hitting a wall or just doing things badly&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;I also tried overwriting geometry without clear:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; //this is the problematic line, if i comment that, memory doesn't increase. _
 _graphicsLayer.Graphics[0].Symbol = polySymbol;&amp;nbsp; 

 _graphicsLayer.Graphics[0].Geometry = ellipse; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;And &lt;EM&gt;using stream&lt;/EM&gt; statement, filestream is properly closed at the end, but used RAM keep increasing till app crashes, each time i update geometry symbol memory use is increased without free previous resources.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:15:18 GMT</pubDate>
    <dc:creator>ErnestoLiria</dc:creator>
    <dc:date>2021-12-11T19:15:18Z</dc:date>
    <item>
      <title>Memory leak updating graphic symbol - ArcGis Runtime .Net</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/memory-leak-updating-graphic-symbol-arcgis-runtime/m-p/427703#M5172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;i'm working with ArcGis Runtime SDK for .Net v10.2.5.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I have an UDP socket listening and waiting for image data that fires a function executed on a different thread in background.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I want to draw the image over a ellipse of arbitrary radius so i use&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; var filestream = System.IO.File.Open(imagepath, FileMode.Open, FileAccess.Read);
 MapPoint point = new MapPoint(center.longitude, center.latitude, SpatialReferences.Wgs84);&amp;nbsp; 
 var polySymbol = new Esri.ArcGISRuntime.Symbology.PictureFillSymbol(); 
 await polySymbol.SetSourceAsync(filestream);&amp;nbsp; 
 var param = new GeodesicEllipseParameters(point, 25, LinearUnits.Meters); 
 var ellipse = GeometryEngine.GeodesicEllipse(param);&amp;nbsp; 

 ***//HERE IS THE PROBLEM*** 
 _graphicsLayer.Graphics.Clear(); 
 _graphicsLayer.Graphics.Add(new Graphic { Geometry = ellipse, Symbol = polySymbol }); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;This is done ~5 times/second. Despite i'm clearing the layer each iteration there is a memory leak that is increasing memory use till app crashes.&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: rgba(248, 248, 248, 0.6);"&gt;I read about problems with memory using ArcGIS and Geometry process, so i'm not sure if i'm hitting a wall or just doing things badly&lt;/P&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;I also tried overwriting geometry without clear:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt; //this is the problematic line, if i comment that, memory doesn't increase. _
 _graphicsLayer.Graphics[0].Symbol = polySymbol;&amp;nbsp; 

 _graphicsLayer.Graphics[0].Geometry = ellipse; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin-bottom: 1em; font-size: 15px; color: #222222; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;And &lt;EM&gt;using stream&lt;/EM&gt; statement, filestream is properly closed at the end, but used RAM keep increasing till app crashes, each time i update geometry symbol memory use is increased without free previous resources.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:15:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/memory-leak-updating-graphic-symbol-arcgis-runtime/m-p/427703#M5172</guid>
      <dc:creator>ErnestoLiria</dc:creator>
      <dc:date>2021-12-11T19:15:18Z</dc:date>
    </item>
  </channel>
</rss>

