The GeoProcessor just keeps on creating "results", how to stop?

497
2
09-01-2010 10:22 AM
DuncanHornby
MVP Notable Contributor
OK all,

Here is a tough one. I've written some VBA (because pythons method of spawning sub-processes meant my code was going to take 62 days...) and I've noticed the memory usage just keeps on creeping up.

At one point I use the geoprocessor to call the Select Tool to create a new shapefile containing 1 point (Which is then used as a pour point for catchment generation)

I create and set the geoprocessor as such:

Set pGP = New GeoProcessor
With pGP
     .OverwriteOutput = True
     .AddOutputsToMap = False
     .LogHistory = False
     .TemporaryMapLayers = True
End With


I call the tool as such:

query = Chr(34) & "ID" & Chr(34) & " = " & CStr(ID)
With pVA
    .RemoveAll
    .Add pFeatureLayer_Sites.FeatureClass
    .Add "in_memory\tempSP"
    .Add query
End With
pStatusbar.Message(0) = "Extracting a single site to in_memory"
Set pGPR = pGP.Execute("Select", pVA, Nothing)
Set pFeatureClass = pGPUtils.OpenFeatureClassFromString(pGPR.GetOutput(0).GetAsText)
Set pGeoDataSetPP = pFeatureClass


I release the memory as such:

With pGPUtils
    .RemoveInternalLayer "tempSP"
    .ClearInMemoryWorkspace
    .RemoveInternalData
    .ReleaseInternals
End With


and I even kill off the geoprocessor within the loop as such:

Set pGP = Nothing
pGPUtils.ReleaseInternals


In Arcmap Tools > options:

Log geoprocessing is ticked off, results are temporary and results management is set to "Never Save"

So at all stages I say NO results, NO logging yet the Select tool still adds an entry in the ArcToolbox results Tab which overtime consumes memory. I need to run this tool a lot of times for a long time but I just can't make ArcMap not Log a result!

Any ideas, any undocumented tips or is this a bug?

Duncan
0 Kudos
2 Replies
isburns
Regular Contributor
Was this ever resolved?  I seem to be experiencing similar behavior, but I'm developing in VB.NET.  I've set the LogHistory property of the ESRI.ArcGIS.Geoprocessor.Geoprocessor to false, but my Results tab still shows the of tools I've executed in the Results tab.  I'm worried about the performance hit because I'm executing 10-15 tools per feature in a feature class.

OK all,

Here is a tough one. I've written some VBA (because pythons method of spawning sub-processes meant my code was going to take 62 days...) and I've noticed the memory usage just keeps on creeping up.

At one point I use the geoprocessor to call the Select Tool to create a new shapefile containing 1 point (Which is then used as a pour point for catchment generation)

I create and set the geoprocessor as such:

Set pGP = New GeoProcessor
With pGP
     .OverwriteOutput = True
     .AddOutputsToMap = False
     .LogHistory = False
     .TemporaryMapLayers = True
End With


I call the tool as such:

query = Chr(34) & "ID" & Chr(34) & " = " & CStr(ID)
With pVA
    .RemoveAll
    .Add pFeatureLayer_Sites.FeatureClass
    .Add "in_memory\tempSP"
    .Add query
End With
pStatusbar.Message(0) = "Extracting a single site to in_memory"
Set pGPR = pGP.Execute("Select", pVA, Nothing)
Set pFeatureClass = pGPUtils.OpenFeatureClassFromString(pGPR.GetOutput(0).GetAsText)
Set pGeoDataSetPP = pFeatureClass


I release the memory as such:

With pGPUtils
    .RemoveInternalLayer "tempSP"
    .ClearInMemoryWorkspace
    .RemoveInternalData
    .ReleaseInternals
End With


and I even kill off the geoprocessor within the loop as such:

Set pGP = Nothing
pGPUtils.ReleaseInternals


In Arcmap Tools > options:

Log geoprocessing is ticked off, results are temporary and results management is set to "Never Save"

So at all stages I say NO results, NO logging yet the Select tool still adds an entry in the ArcToolbox results Tab which overtime consumes memory. I need to run this tool a lot of times for a long time but I just can't make ArcMap not Log a result!

Any ideas, any undocumented tips or is this a bug?

Duncan
0 Kudos
DuncanHornby
MVP Notable Contributor
Shea,

Short answer is no.  I just had to put up with ArcMap failing after X iterations (can't remember how many but only a few thousands).

Duncan
0 Kudos