<?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: Do geoprocessing tools leak handles (C#)? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524164#M14114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for your answers Ken and Alexander.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed your proposition using the 'using' statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately to no avail. Handles are still counting up during execution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'm still looking for a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards Monika&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Dec 2010 06:31:35 GMT</pubDate>
    <dc:creator>MonikaThül</dc:creator>
    <dc:date>2010-12-02T06:31:35Z</dc:date>
    <item>
      <title>Do geoprocessing tools leak handles (C#)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524159#M14109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear list,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a problem with a geoprocessing tool I implemented (C#).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's using lots of ESRI's geoprocessing tools (mostly SingleOutputMapAlgebra). During the tool's execution the count of windows handles in use is rising and rising. Even (hours) after the tool has finished the handles are not freed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not display result data in the map. So I see no reason for ArcMap to keep the handles. Saving the mxd document, clearing the results list of the current session don't help either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anybody made the same observation?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to force ArcMap to release unused handles?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any hints will be appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Monika&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 05:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524159#M14109</guid>
      <dc:creator>MonikaThül</dc:creator>
      <dc:date>2010-12-01T05:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Do geoprocessing tools leak handles (C#)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524160#M14110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am assuming you are creating a geoprocessor object in your C# code.&amp;nbsp; Do you dispose of this object using the arcobjects comreleaser or using the .net release com object method after you are done?&amp;nbsp; If not I suggest you do, it may help free the memory and/or handles.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 14:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524160#M14110</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2010-12-01T14:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Do geoprocessing tools leak handles (C#)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524161#M14111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Alexander,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;since SingleOutputMapAlgebra is not an instance of ComObject I do not use the comreleaser (neither arcobjects nor .NET).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or do I miss anything about the concept of COM objects?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Monika&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 14:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524161#M14111</guid>
      <dc:creator>MonikaThül</dc:creator>
      <dc:date>2010-12-01T14:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Do geoprocessing tools leak handles (C#)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524162#M14112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In my 9.x projects using the Geoprocessor, I would use the ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject at the end of the geoprocessing routine. Here's an example (in VB.NET). However, I'm not sure what to use in ArcGIS 10&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; Friend Sub DeleteDataset(ByVal InputName As Object)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim DSDelete As New ESRI.ArcGIS.DataManagementTools.Delete
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult

&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSDelete.in_data = InputName

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = RunTool(DSDelete, Nothing)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Result Is Nothing Then System.Windows.Forms.MessageBox.Show("Unable to delete dataset '" &amp;amp; InputName &amp;amp; "'", "Unable to delete", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Exclamation)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExceptionMessage(ex, "Delete Dataset")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(DSDelete)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try

&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524162#M14112</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T22:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Do geoprocessing tools leak handles (C#)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524163#M14113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To my knowledge everything in ArcGIS that is exposed through an API is a COM object.&amp;nbsp; Even the objects in python are com objects underneath.&amp;nbsp; Same for the .NET and Java API (I haven't done much with the C++ API.)&amp;nbsp; Ken's code is good, I like to write it a little different with a using block (you can do the same in C#) and then I handle the exceptions at the highest level possible:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Friend Sub DeleteDataset(ByVal InputName As Object)


&amp;nbsp;&amp;nbsp;&amp;nbsp; Using releaser as new ComReleaser

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim DSDelete As New ESRI.ArcGIS.DataManagementTools.Delete
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; releaser.ManageLifeTime(DSDelete)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DSDelete.in_data = InputName

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result = RunTool(DSDelete, Nothing)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Result Is Nothing Then System.Windows.Forms.MessageBox.Show("Unable to delete dataset '" &amp;amp; InputName &amp;amp; "'", "Unable to delete", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Exclamation)

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Using

&amp;nbsp; End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:51:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524163#M14113</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2021-12-11T22:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Do geoprocessing tools leak handles (C#)?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524164#M14114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks for your answers Ken and Alexander.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I followed your proposition using the 'using' statement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately to no avail. Handles are still counting up during execution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I'm still looking for a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards Monika&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 06:31:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/do-geoprocessing-tools-leak-handles-c/m-p/524164#M14114</guid>
      <dc:creator>MonikaThül</dc:creator>
      <dc:date>2010-12-02T06:31:35Z</dc:date>
    </item>
  </channel>
</rss>

