Hornbydd

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

Discussion created by Hornbydd on Sep 1, 2010
Latest reply on Sep 6, 2012 by Hornbydd
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

Outcomes