I recently wrote a toolbox for arcgis pro that to calculate pullution distributions. I had a few hundred points in my example, then calculated the distribution of contaminants near each point, stored it as a raster, and then merged those rasters into the final result using the mosaic function. But I'm running into two problems.
The first problem is that I find that when I run the code in pycharm with arcpy called, the code calculates significantly faster than under arcgis pro. May I ask what is the reason for this? And as I run my code under arcgis pro over and over, the code takes more and more time to run. My guess is that it's because the code stores some intermediate shapefile variables in memory. But I manually added the statement to remove the intermediate shapefile variables at the end of the code and it still causes the code to slow down. Can I avoid this problem? I know I can avoid this problem by restarting arcgis pro, but are there any other solutions?
Another problem is that after running the code very many times in arcgis pro, it is possible to get an error saying that the mosaic function did not execute properly (ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. Failed to execute (Mosaic).). May I ask what is the reason for this? When I restart arcgis pro, my code still executes fine.