I have a arcpy python script that runs a process that I publish as a geoprocessing service on ArcGIS Server 10.3.1. The python script uses various input feature classes. These feature classes are within geodatabases that are registered on the ArcGIS Server.
My python script also uses the
in_memory workspace for storage of some temporary data. The
in_memory feature classes are not the input or final output, there are only intermediate data.
When trying to publish the geoprocessing service, the publishing tools want to copy the
in_memory feature classes to the server, since the
in_memory workspace is not registered with ArcGIS Server. The specific warning I get is
Data source used by Script MyToolThatDoesStuff is not registered with the server and will be copied to the server: in_memory\myTempData
I let the publishing tools copy the
in_memory data to the server and the my geoprocessing service works as expected. However, I suspect that every time the tool is run, the
in_memory data is copied to the
arcgisserver\directories\arcgissystem\arcgisinput\ MyToolThatDoesStuff .GPServer\extracted\v101\data1.gdb geodatabase and never removed. Over time this gdb bloats, slows down the geoprocessing service and ultimately fills the disk, creating mass problems.
- Is there a way to prevent the geoprocessing tools from publishing
in_memoryworkspace to the server?
- Is there a way to register the
in_memoryworkspace with ArcGIS Server?
- Is using the
in_memoryworkspace in scripts that are published as geoprocessing services not “best practice”. If that's the case, how should temporary, intermediate data be processed in arcpy scripts?