Jill, Did you find any solution? As we have added more overlapping parcels to our feature class (we now have 860), I too seem to be running into memory issues. My script was crashing, so I added another loop that uses a smaller cursor and repeatedly deletes the searchCursor. It no longer crashes, but interestingly enough, a "zone" is processed in about 20 seconds at the outset, and then towards the end of the 800 features, it slows down to about 5 minutes to process one zone. Below is the python code that I am using.
#create overlapping polygons with intersect tool (intersect with self, only creates partial parcels where overlapping)
arcpy.Intersect_analysis([inputParcelLayer],FeatureIntersect,"NO_FID","","")
#make feature layer, join with self intersected parcels, use result as overlapping parcels for zonal stats
arcpy.MakeFeatureLayer_management(inputParcelLayer,"parcelsoverlap")
arcpy.AddJoin_management("parcelsoverlap","APN",FeatureIntersect,"APN","KEEP_COMMON")
arcpy.CopyFeatures_management("parcelsoverlap", FeatureZone)
tempDIR = arcpy.GetSystemEnvironment("TEMP")
#create scratch workspace name
tempWorkspace = "tempWorkspaceForZonalStats"
if not arcpy.Exists(tempDIR + os.sep + tempWorkspace):
arcpy.CreateFolder_management(tempDIR, tempWorkspace)
arcpy.env.workspace = tempDIR + os.sep + tempWorkspace
#input variables
strFIDname = arcpy.Describe(FeatureZone).OIDFieldName
zone = "zone"
arcpy.env.cellSize = 2 #needed to reduce cell size because zonal stats crashes if the polygon is smaller than raster resolution
gc.enable() #enable garbage collection
arcpy.CheckOutExtension("Spatial")
cellAssign = "CELL_CENTER"
priority = "NONE"
newSelection = "NEW_SELECTION"
# Make a layer from the feature class
arcpy.MakeFeatureLayer_management(FeatureZone, zone)
#Loop through features
numFeats = int(arcpy.GetCount_management(FeatureZone).getOutput(0))
groups = []
bracket = 30
while(bracket < numFeats):
groups.append(bracket)
bracket = bracket + 30
groups.append(numFeats+1)
for x in groups:
whileClause = '"OBJECTID" >= ' + str(x-30) + ' and "OBJECTID" < ' + str(x)
print whileClause
inRows = arcpy.SearchCursor(FeatureZone,whileClause)
#inRows = arcpy.SearchCursor(FeatureZone)
inRow = inRows.next()
while inRow:
#selct the fid to process
strID = inRow.getValue(strFIDname)
print ' processing objID: ' + str(strID) + 'of ' + str(numFeats) + ' total features.'
strQry = '"%s" = %s' % (strFIDname, strID)
arcpy.SelectLayerByAttribute_management(zone, newSelection, strQry)
#create a unique name for the zone
uniqueZone = arcpy.CreateUniqueName("zone.shp", arcpy.env.workspace)
uniqueTable = arcpy.CreateUniqueName("ZSasT", arcpy.env.workspace)
#create a temporary feature to use for zonal stats as table
arcpy.CopyFeatures_management(zone, uniqueZone)
outZSaT = ZonalStatisticsAsTable(uniqueZone, joinField, valueRaster, uniqueTable, "NODATA", "ALL")
#move to next record.
inRow = inRows.next()
del inRow
del inRows