Hi all,
A colleague of mine has noted that she has "found that some arcpy or arcgis api tools only work with 'in_memory' instead of 'memory'. ", and that switching from one to the other sometimes gets the intended result (versus failing).
Would anyone have any information on how the two workspaces differ? The documentation here is pretty light: Write geoprocessing output to memory—ArcGIS Pro | Documentation
Something that would be extremely helpful is a list of which geoprocessing tools support which workspace(s).
It looks like the page @JoshuaBixby mentioned here got folded into the current Write geoprocessing to memory page: Re: in_memory\ for geoprocessing in ArcGis Pro? - Esri Community In that post, he noted that
In Pro 2.4.x and newer (possibly 2.3.x too), "memory" should store data sets in-memory when using the interactive Python window in Pro while "in_memory" will store data sets on disk.
He also noted
The original in-memory workspace, i.e., "in_memory", is actually only in memory when run out of process, not when run within the ArcGIS Pro application. TheConsiderations when using the in_memory workspace—Appendices | Documentationcovers this topic.
If you want intermediate data sets to be in actual memory while using the ArcGIS Pro application, you need to use the newer in-memory workspace, i.e., "memory". Just be aware, older ArcPy tools that require the workspace to be set using arcpy.env.workspace don't support either in-memory workspace with ArcGIS Pro.
On the same forum thread, another user noted similar behaviour while doing viewshed analysis: Re: in_memory\ for geoprocessing in ArcGis Pro? - Esri Community
Unfortunately, all the links in this thread now point back to that same documentation page: Solved: Re: Working with in_memory? - Esri Community
The only geoprocessing tool that's ever given me trouble with the memory workspace was Project and that might've been fixed over the years. In general, if the tool doesn't operate on a whole workspace, a feature dataset, or anything that has to reside in a feature dataset then it'll work with the memory workspace. Don't use "in_memory" unless you still need ArcMap compatibility.
Given it has been nearly 6 years since ArcGIS Pro 2.4 was released, I would take any documentation and comments from back then with a grain of salt, even if they were accurate/correct at the time. The "memory" workspace has continually, albeit slowly, improved over the releases. For all intents and purposes, "in_memory" is now a legacy artifact that should not be used.