Trying to run cost distance tool in ArcMap, but I keep getting the following results:

ERROR 999999: Error executing function.
("esriDataSourcesRaster.InMemoryRasterHelper") Failed because of out of memory
ERROR 010029: Unable to create the raster in_memory\CDrast. Cost Distance mapping Failed
ERROR 010067: Error in executing grid expression.
Failed to execute (Cost Distance).

Initial thoughts were memory constraints, but I've ran it on several computers with high ram (~ 16 to 40 GB) and still got the same error codes. The inputs are 4 bit Int TIFFs (~1.8 GiB), which were compressed to 2 bit TIFFs (~930 MiB) again still same error codes. I can successfully save it to a path, but when it comes to in_memory the tool does not work.

  • 32-bit applications cannot use that much RAM -- The effective limit is closer to 800Mb. In the future please specify the size of the raster(s). – Vince Sep 3 '16 at 1:14
  • The 4 bit rasters are ~1.8 GiB and 2 bit rasters are ~ 930 MiB. Also, by effective size limit are you referring to the size of the input rasters? I can try compressing them further and see if it is successful. – cptpython Sep 3 '16 at 3:02
  • "Effective size limit" is the sum of all objects placed in the heap (including the Python language itself). Individual objects shoildnt exceed 50Mb. – Vince Sep 3 '16 at 4:02
  • Please edit the question to contain details instead of placing the in the comments. – Vince Sep 3 '16 at 4:07
  • That complicates the issue because the heap will be greater than 1 GiB. I believe running this in_memory isn't an option. Do you recommend any other strategies to speed up processing of cost distance tool? – cptpython Sep 3 '16 at 4:12

So after much experimentation and help from @Vince, @Curtis Price and other GIS professionals. We believe that the issue is related to how ArcGIS handles RAM usage and large rasters in_memory so the best work around is running 64-bit geoprocessing which considerably improved our run-times (32bit run-time ~1.2 hrs and 64bit run-time ~0.8). Also, other factor was use of SSDs improved the processing speed as well. The original reason for running CD in_memory was to improve workflow speed which has been achieved, but it still doesn't entirely explain why does in_memory fails despite under aforementioned circumstances.


If running in ArcMap foreground processing, you have to fit ArcMap, Python and your data into a limited space (3.2 GB). Have you tried running this workflow in background processing, or standalone from a Python script?

  • So far we've tried the following methods: - Tried running CD tool in_memory with 64-bit Background Geoprocessing as suggested by @Vince. The tool runs for 7 minutes or so, but no cost distance raster is produced - Tried using ArcPro and tried running it in_memory gives us the same result as above So far we were able to slice a piece of the raster (~1/10th of original size) and it successfully run it in_memory, but slicing the rasters and incorporating them into our workflow is something we'd like to avoid. – cptpython Sep 9 '16 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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