I am working with Jupyter notebooks in ArcGIS Pro and would like to write some Feature layers to memory to speed up my operation. Currently it is taking roughly 24 hours. I have to emphasize it is very important that they are written to memory as a feature layer and not a feature class, otherwise my code will not run correctly. I have found that I can get my point feature layers written to memory using the code below. However rewriting the layer to memory such as in a loop causes Pro to crash.
arcpy.management.CopyFeatures('ServiceLocation', "memory/ServiceLocationCopy") I have tried deleting the feature layer from memory before writing again and it still causes crashing. It is a hard crash without any errors given and just gives me the option to send a crash report. The code below will reliably cause my system to crash.
arcpy.management.CopyFeatures('ServiceLocation', "memory/ServiceLocationCopy") arcpy.Delete_management("memory/ServiceLocationCopy") arcpy.management.CopyFeatures('ServiceLocation', "memory/ServiceLocationCopy") Currently I am running ArcGIS Pro 3.0.2, due to company policies I am unable to make any updates to my system. ServiceLocation is a simple point feature layer with no z values. I am wondering if this operation will cause Pro to crash for other users and if there is another way to write feature layers to memory that will not cause crashes.
print(arcpy.Describe("ServiceLocationCopy").dataType)returnsFeatureLayerwhile callingprint(arcpy.Describe("memory/ServiceLocationCopy").dataType)returnsFeatureClass. Using"memory/ServiceLocationCopy"in functions does not provide selections however using"ServiceLocationCopy"does. In the end after I got everything working using the fix below my code was just as slow as before using memory. Looping is slow without the use of dictionaries which I'm still learning.