There are 102 raster files in total that I want to convert to points. Each raster file is 2160x4320 pixels. When running the script in the code block below, the process hangs into the third or fourth raster file, regardless of if I take a random sample of the 102 rasters to start with. Even taking a subset of six of these rasters and converting them to points leads my machine to hang on the third raster file.
The first two rasters both take around 10 minutes to convert, and the third raster file was processing for 10 hours before I stopped it. While the third raster file was being processed, I noticed that ArcMap's associated RuntimeLocalServer.exe private memory allocation for RAM grew from ~900mb after completing the first two and starting on the third to ~2600mb once I stopped the process.
Regarding the machine I'm using - I'm using ArcGIS 10.5 on a computer with a i7-6700K processor, 32GB ram, and a terabyte SSD. The computer is good working order in terms of software and hardware.
When run on a desktop a few years older with only 16GB of RAM, the same script below has crashed ArcGIS and left the routine incomplete after about three files are processed. It seems like ArcGIS isn't clearing VRAM or RAM used for already-converted raster files, but I have no idea if this is actually the problem.
Is there some ArcPy memory management command that I can include in my code below? Why is this process consistently failing to finish?
# Convert all rasters in a directory to points. import arcpy import os conversionList =  for root, dirs, files in os.walk(r"D:/data/crops/earthstat/HarvestedAreaYieldMajorCrops_Geotiff/"): for f in files: if f.endswith(".tif"): fpath = root + "/"+ f conversionList.append(fpath) outputPath = r"D:/data/crops/earthstat/HarvestedAreaYieldMajorCrops_Points/" for item in conversionList: infile = str(item) outfile = outputPath + item.split("/")[-1].split(".") + ".shp" arcpy.RasterToPoint_conversion(infile, outfile, "Value")