| Report Inappropriate Content
This Forum is closed for replies.
||Is there a known memory leak in the geoprocessor of ArcGIS 9.1?
||Nov 13, 2005
I have found that calling certain functions that check for, delete, or create rasters in a personal geodatabase--e.g.,
-- leads PythonWin (2.4 and 2.1; I've tried both) to consume ever-increasing amounts of memory. For example, if I have a geodatabase workspace that contains many rasters, 100 calls to GP.exists() increases PythonWin memory use by about 25 MB.
I observe the same sort of trouble when executing the code below, which populates a geodatabase with many small rasters, each extracted by polygon from a large raster. After several hundred iterations, PythonWin's memory consumption increases to 1 GB from about 100 MB, and the geoprocessor aborts with a complaint about memory availability.
I have tried removing (via del) the result of those calls that return values, such as GP.exists; this has no useful effect.
Is there a known memory leak in the geoprocessor, or perhaps a known tendency toward gratuitious caching? Is there any way to avoid the problems I describe, and/or encourage the geoprocessor (rather than Python) to perform garbage collection?
clippedRasterExists = GP.exists(clippedRaster)
for i in range(nrows):
outRaster = labelList[i]
outRasterExists = outRaster in outWorkspaceRasters
if overWrite and outRasterExists:
print "Deleting " + outRaster
if (not outRasterExists) or overWrite:
inPolygon = polygonList[i]
inBoundingBox = boundingBoxList[i]
print "Deleting " + clippedRaster
print str(i) + ": Creating clipped raster " + clippedRaster + " ("+inBoundingBox+")"
GP.Clip_management(inWorkspace + "/" + inRaster, inBoundingBox, clippedRaster)
clippedRasterExists = True
print str(i) + ": Creating new " + outRaster
GP.ExtractByPolygon_sa(clippedRaster, inPolygon, outRaster, "INSIDE")
print str(i) + ": Skipping " + outRaster + " (already exists)"
WinXP Pro SP2
3.2GHz P4, 3GB RAM