<?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: Memory Leak on referencing IMap instance in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1041958#M20299</link>
    <description>&lt;P&gt;Anyone help me out? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 14:57:27 GMT</pubDate>
    <dc:creator>mannokmannok</dc:creator>
    <dc:date>2021-03-30T14:57:27Z</dc:date>
    <item>
      <title>Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1040924#M20295</link>
      <description>&lt;P&gt;var pMd = new MapDocumentClass();&lt;BR /&gt;pMd.Open(RevisionState.CurrentBackupMXDPath_.BSValue());&lt;BR /&gt;var pMap = pMd.Map[0];&lt;BR /&gt;pMd.Close();&lt;BR /&gt;Marshal.FinalReleaseComObject(pMap);&lt;BR /&gt;pMap = null;&lt;BR /&gt;Marshal.FinalReleaseComObject(pMd);&lt;BR /&gt;pMd = null;&lt;BR /&gt;GC.Collect();&lt;BR /&gt;GC.WaitForPendingFinalizers();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please see the code above. I found that memory usage increased so much while executing&amp;nbsp;&lt;/SPAN&gt;var pMap = pMd.Map[0];&lt;SPAN&gt;. However, I cannot release these memory even I run all the rest of the statement. May I know how can I release&amp;nbsp;&lt;/SPAN&gt;IMap&lt;SPAN&gt;&amp;nbsp;reference? Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 03:08:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1040924#M20295</guid>
      <dc:creator>mannokmannok</dc:creator>
      <dc:date>2021-03-26T03:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1040925#M20296</link>
      <description>&lt;P&gt;Maybe try calling Collect() and WaitforPendingFinalizers before closing, as described here:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.esri.com/t5/arcobjects-sdk-questions/layers-from-sde-database-are-shown-as-invalid/m-p/1030459/highlight/true#M20253" target="_blank"&gt;https://community.esri.com/t5/arcobjects-sdk-questions/layers-from-sde-database-are-shown-as-invalid/m-p/1030459/highlight/true#M20253&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 03:24:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1040925#M20296</guid>
      <dc:creator>KirkKuykendall1</dc:creator>
      <dc:date>2021-03-26T03:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1040927#M20297</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/201161"&gt;@KirkKuykendall1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have tried just now but no luck... Memory usage of this statement cost me 50000KB of memory. Even I run the rest statements in this order...&lt;/P&gt;&lt;P&gt;var pMd = new MapDocumentClass();&lt;BR /&gt;pMd.Open(RevisionState.CurrentBackupMXDPath_.BSValue());&lt;BR /&gt;var pMap = pMd.Map[0];&lt;BR /&gt;GC.Collect();&lt;BR /&gt;GC.WaitForPendingFinalizers();&lt;BR /&gt;pMd.Close();&lt;BR /&gt;Marshal.FinalReleaseComObject(pMap);&lt;BR /&gt;pMap = null;&lt;BR /&gt;Marshal.FinalReleaseComObject(pMd);&lt;BR /&gt;pMd = null;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The memory usage drops only ~1000KB&amp;nbsp; &amp;nbsp;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 03:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1040927#M20297</guid>
      <dc:creator>mannokmannok</dc:creator>
      <dc:date>2021-03-26T03:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1041958#M20299</link>
      <description>&lt;P&gt;Anyone help me out? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 14:57:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1041958#M20299</guid>
      <dc:creator>mannokmannok</dc:creator>
      <dc:date>2021-03-30T14:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1043796#M20301</link>
      <description>&lt;P&gt;At the very end of all of my projects in "Dispose" of my form with the map I always include&lt;/P&gt;&lt;P&gt;ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown();&lt;/P&gt;&lt;P&gt;This is in the ESRI.ArcGIS.ADF.Local resource.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have never had an issue and I don't need to do the garbage collecting and marshalling.&lt;/P&gt;&lt;P&gt;Brent Hoskisson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 15:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1043796#M20301</guid>
      <dc:creator>BrentHoskisson</dc:creator>
      <dc:date>2021-04-05T15:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1044544#M20303</link>
      <description>&lt;P&gt;This is because you are playing with a short-run process. For me, I am working with a long run process which lives as long as the lifetime of an ArcMap session.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 07:59:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1044544#M20303</guid>
      <dc:creator>mannokmannok</dc:creator>
      <dc:date>2021-04-07T07:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Memory Leak on referencing IMap instance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1057975#M20318</link>
      <description>&lt;P&gt;What is in the map? Do you have basemaps displaying, layers linking to say datasets stored in ArcGIS Online or ArcServer that maybe maintaining a link thus not allowing memory to be released? I would try a simple map with say a locally stored shapefile as&amp;nbsp; a test. See if you can track the problem down.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 09:35:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/memory-leak-on-referencing-imap-instance/m-p/1057975#M20318</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-05-14T09:35:31Z</dc:date>
    </item>
  </channel>
</rss>

