Is there a way of clearing (flushing) the Python Window in ArcMap from Python (that works in 10.2.1)?
The issue is if I write in the python window:
data = []
for row in some_fc:
data.append(row stuff)
I now have this in memory,. Clearing the screen is good, but I can still do :
print data
to get back my stuff, so memory is used. How to release this?
Just del data, garbage collection will shortly reclaim the memory.
you seem to have missed del
and if you want to track and otherwise play with the garbage, look at the gc module
import gc
dir(gc)['DEBUG_COLLECTABLE', 'DEBUG_LEAK', 'DEBUG_SAVEALL', 'DEBUG_STATS',
'DEBUG_UNCOLLECTABLE', '__doc__', '__loader__', '__name__', '__package__', '__spec__',
'callbacks', 'collect', 'disable', 'enable', 'garbage', 'get_count', 'get_debug',
'get_objects', 'get_referents', 'get_referrers', 'get_stats', 'get_threshold',
'is_tracked', 'isenabled', 'set_debug', 'set_threshold']