Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been using in_memory workspace within ArcGIS 10.1 ModelBuilder as part of a workflow to mosaic and clip raster datasets to study area bounds (Figure 1). The model runs fine the first round but crashes the program on the second or third run. I suspect two issues may be occuring: 1) Memory limitation are being exceeded or 2) There is conflict when trying to overwrite temp files in_memory.

Is there a way to clear in_memory workspace from within ModelBuilder?

Figure 1.

enter image description here


The final model that is now stable

enter image description here

share|improve this question
up vote 11 down vote accepted

You can add the Delete tool and specify %in_memory% as the Input Data Element. I would also make mosaic_clp.img a precondition for the Delete operation, to make sure the in_memory workspace isn't cleared prematurely.

share|improve this answer
A quick and simple solution. Thanks! – Aaron Apr 3 '13 at 19:08
Happy to help! Also, I haven't checked, but I think you can select in_memory from the Delete tool's dropdown menu -- it wouldn't change the way the model works at all, but it would remove the redundant %in_memory% variable bubble. – nmpeterson Apr 3 '13 at 20:07
I followed your description, and it seems I cannot add %in_memory% as Input Data Element - it tells me there is no such element. However, if I use in_memory without the %, it works fine! – Alex Jan 28 '15 at 15:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.