<?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 Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81411#M872</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the excellent repro app. Unfortunately I am unable to the memory growth you were seeing with the 10.2.7 release. The memory profile actually looks very stable - your repro has been running for almost 30mins: memory climbed to 192MB after 5 seconds&amp;nbsp;and stayed at that level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="382837" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/382837_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Nov 2017 20:40:39 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2017-11-07T20:40:39Z</dc:date>
    <item>
      <title>Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81406#M867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trying to debug some private byte allocation leaks in my application and finally think I've narrowed it down to the PictureMarkerSymbol.SetSourceAsync() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My use case consists of updating &lt;EM&gt;n&lt;/EM&gt; number of PictureMarkerSymbol sources/geometries on the map once every ~100ms. Through a combination of Redgate, WinDbg, and ultimately DebugDiag I pinpointed the culprit (I think) to RuntimeCoreNet calling into msvcr120::malloc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm setting the source of my PictureMarkerSymbols like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;private async void periodicUpdate()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BitmapFrame frame = BitmapFrame.Create(this.someBitmapSource);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PngBitmapEncoder encoder = new PngBitmapEncoder();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; encoder.Frames.Add(frame);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (Stream stream = new MemoryStream())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; encoder.Save(stream);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Seek(0, SeekOrigin.Begin);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await this.pictureSymbol.SetSourceAsync(stream);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Has anyone else encountered this issue? Am I setting the source incorrectly or otherwise missing something else? The leak seems to be pretty linear in growth and will generate an OutOfMemoryException fairly reliably.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2016 22:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81406#M867</guid>
      <dc:creator>AaronHigh</dc:creator>
      <dc:date>2016-02-24T22:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81407#M868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's worth noting that I'm seeing the same behavior (linear private heap allocation increase) when setting the source using the synchronous method and a byte array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 16:27:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81407#M868</guid>
      <dc:creator>AaronHigh</dc:creator>
      <dc:date>2016-02-25T16:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81408#M869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can you add a small repro app which demonstrates the issue you are seeing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 17:15:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81408#M869</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2016-02-25T17:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81409#M870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This appears to do it but only after a few hours. What's interesting is that if I change map scale it seems to reset the spiked memory usage for a time, however that same "workaround" doesn't have a similar impact on my actual application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 23:25:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81409#M870</guid>
      <dc:creator>AaronHigh</dc:creator>
      <dc:date>2016-02-25T23:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81410#M871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Was there any resolution to this? I believe I'm seeing the same thing. I use multiple PictureMarkerSymbols on my map and I&amp;nbsp;have started to notice a similar result. It happens gradually, but runs out of memory over a few hours.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 16:52:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81410#M871</guid>
      <dc:creator>ClayGinn</dc:creator>
      <dc:date>2017-11-07T16:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81411#M872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aaron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the excellent repro app. Unfortunately I am unable to the memory growth you were seeing with the 10.2.7 release. The memory profile actually looks very stable - your repro has been running for almost 30mins: memory climbed to 192MB after 5 seconds&amp;nbsp;and stayed at that level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="382837" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/382837_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:40:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81411#M872</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2017-11-07T20:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81412#M873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't able to reproduce any issue using the repro case above recompiled for v100.1. Again, the memory profile stays pretty stable,&amp;nbsp;rising to approx. 200 within the first 5-10 seconds then staying level.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/382846_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am very keen to get another repro case if you have one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2017 21:36:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81412#M873</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2017-11-07T21:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Native memory leak in PictureMarkerSymbol.SetSourceAsync()?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81413#M874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've started running into a similar problem, with similar results: &lt;A href="https://community.esri.com/migrated-users/12164"&gt;Aaron High&lt;/A&gt;'s repro app was running fine for me despite me seeing an issue in a larger application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able, however, to make a small change to Aaron's demo that results in the app consistently and quickly crashing for me (attached). The change is to increase the number of graphics objects being drawn. On my computer, the attached code begins to misbehave almost immediately. On a coworker's (newer) computer, he had to increase the graphics count to 1000 before the app would crash within a&amp;nbsp;few minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both computers are running Windows 7, 64-bit, using version 10.2.7 of the runtime.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2018 21:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/native-memory-leak-in-picturemarkersymbol/m-p/81413#M874</guid>
      <dc:creator>DanBrandt</dc:creator>
      <dc:date>2018-07-18T21:33:19Z</dc:date>
    </item>
  </channel>
</rss>

