AnsweredAssumed Answered

Clearing "Current Session" Results Window using ArcPy

Question asked by nradakovic on Jan 5, 2018
Latest reply on Jan 5, 2018 by Dan_Patterson

I wrote a script in for ArcMap 10.1 using ArcPy. The script loops through different buffer lengths and matches a number of points to a number of lines. As an example, I create a 5 metre buffer around all the points and then match the points to certain lines, then I would do this with a 10 metre buffer, then a 15 metre buffer, a 20 metre buffer, etc. My memory continuously grows from one run through the loop to the next, even though after I analyze each buffer area I delete all the temporary layers and clean any lists I had stored in memory. After doing about 3 buffer areas I reach the 3 GB memory limit, and my script crashes.

 

After doing some digging I realized that my memory continuously grows because ArcMap writes out the results of every calculation to the “Results Window”.  Since I am doing thousands of calculations, this fills up fairly quickly. Once I stop my script and manually delete the “Current Session” log I regain majority of my computer’s memory. My question is, how can I delete the “Current Session” logs using Arcpy? I would like to be able to delete the “Current Session” log after each run through the loop without having to do it manually. This would allow me to free up my computer’s memory.

 

Note: I tried using “arcpy.SetLogHistory(False)” to no avail.

Outcomes