Select to view content in your preferred language

Removed.

2506
10
12-01-2016 07:39 PM
X_K_YANG
Emerging Contributor
0 Kudos
10 Replies
DanPatterson_Retired
MVP Emeritus

Can edit your post and format your code using syntax highlighting to rule out simple errors and to make it readable please

/blogs/dan_patterson/2016/08/14/script-formatting 

0 Kudos
X_K_YANG
Emerging Contributor

Hi Dan, thanks for your tips. I've updated the post already.

0 Kudos
LukeWebb
Frequent Contributor

Tried to see something obvious but couldnt to me! If my python.exe itself crashes, I usually get an exit code at a minimum. (If run from an IDE)  e.g. any standard time my process finishes , or crashes with a standard python trackback, it says:

Process finished with exit code 0  (Above my console)

However if python .exe crashes, my IDE usually has something like:

Process finished with exit code -2723923718

Which you can then sometimes google to point you in the right direction.

LukeWebb
Frequent Contributor

What you could try to do is print out the path to the rasters that crash during: 

sumDT + dTTemp

Then try to load these 2 files into arcmap, and try and Raster calc them manually (Or whatever that line of code does), and see if you get a better error message or if Arc crashes.

If Arc crashes, its likely an issue with your input data / possible data format limitation. 

e.g. if you are trying to add 2 tiffs, from different extents, the resulting file may exceed the maximum TIFF file size / maybe an individual calculated cell value, ends up larger than the range the TIFF format allows. (Guessing without seeing your data!)

X_K_YANG
Emerging Contributor

Hi Luke, yes, previously arcpy python.exe offten crashed with an error "Process finished with exit code .....". I fixed the arcpy bug according this post:

arcgis 10.1 - What might cause "python.exe has stopped working" when closing ArcPy script? - Geograp... 

So, now,  arcpy still stop working randomly, but no error returned.

0 Kudos
RandyKreuziger
Frequent Contributor

Are you running the python script in an IDE or in a Windows cmd?

0 Kudos
X_K_YANG
Emerging Contributor

Same error happened from both IDE or in a Windows cmd.

0 Kudos
ClintonDow1
Frequent Contributor

When dealing with large raster datasets the system memory can sometimes be the issue - when your script runs do you hit the cap on your RAM?

I have run into this issue in a few cases for example with high resolution height maps of large surface areas - you can avoid it by making use of scratch workspaces and writing intermediate rasters to disk, then explicitly calling del on the raster to free up the space held in memory. It does slow down the overall script performance to work from disk so you'll need to weigh the trade-off of speed vs. file size limitations.

0 Kudos
X_K_YANG
Emerging Contributor

My laptop has 12GB memory, but the used memory is less than 5GB. So, I'm sure the memory is enough for the task. However, you could be right because ArcGIS is still using 32-bit Python, it could not used memory larger than 4GB. However, arcpy is really very weak in supporting 64-bit Python. But I'm pretty sure this crucial bug in Arcpy. ESRI should investigate and fix it as soon as possible.

Same issue have been reported online:

such as:

watershed - ArcPy script stops running randomly with no error returned - Geographic Information Syst... 

ArcPy script causing python.exe to stop working (memory issue?) - Geographic Information Systems Sta... 

0 Kudos