Indeed, marking intermediate parameters as Managed can cause issues. Below is an example of using the Raster Calculator and then Raster to Polygon. When using in_memory
the model fails; when marking the intermediate outputs as Managed, the in_memory - even though exists in the output path - is ignored and the data is written to %temp%, as the Scratch folder.
According to the in-memory workspace documentation, "Tables, feature classes, and rasters can be written to the in-memory workspace" and therefore it is not clear why it fails. This is not the first time that a 'funny' behavior of in_memory
is reported by users, in this 4-part article the author reports of what seems to be in_memory data written to the disk rather than to the RAM (Python, ArcGIS 10.2.2). I therefore find that using Managed is to 'play it safe' in a way, saves the trouble of testing how each model performs.
With that in mind, I would like to mention two additional aspects to consider. Firstly, if the Model is to be published to ArcGIS Server, administrators may prefer the use of memory over storage and vice versa depending on the available resources and architecture; Secondly, according to the ArcGIS Pro documentation, Managed and Intermediate "The Intermediate and Managed options have been removed in ArcGIS Pro ModelBuilder". I gave it a go and tried both options in ArcGIS Pro 1.0. Surprisingly (or not), the results are exactly the same as running the Model from ArcCatalog.
The above is for 10.3.1 and not 10.1 (the version in question). However, the key relevant documentation has not changed since. I used Win7 and Win 2008 R2.
Making intermediate data managed data - 10.1 | 10.3.1/latest
Using in-memory workspace - 10.1 | 10.3.1/latest
Whilst preparing this data to send off to ESRI support I did a quick test of copying and pasting the whole model into a new blank Model.
The model now works OK from both Edit and Open windows without adding in any extra Tools / processes.
However this issue - as explained above - happens so frequently that I would be very interested to hear from anyone else reporting similar issues.
For now I have not included the additional "calculate statistics" tools in my model, it remains unclear if the occurrence of these errors messages, and the different behavior between the Open and Edit window is a symptom of an unstable model that is resolved, or if it will re-occur.
Best Answer
I don't have an answer to avoid this issue but my typical solution is to backup the model occasionally. The "failed to save" error just happened to me. It is frustrating to say the least. If you don't have a backup, you lose everything. When you open the model later it is completely empty.
I brought this problem up at the UC a couple years ago to one of the model builder reps from ESRI, but he had never heard of it. I know of at least 4 other people in my office that have had this happen. It seems to occur when my model gets fairly large.