After reading http://www.python.org/doc/faq/general/#how-does-python-manage-memory, I tried modifying this program as below:
a=[]
for i in xrange(33,127): for j in xrange(33,127): for k in xrange(33,127): for l in xrange(33, 127): a.append(chr(i)+chr(j)+chr(k)+chr(l))
import sys sys.exc_clear() sys.exc_traceback = sys.last_traceback = None del(a)
import gc gc.collect()
And it still never frees up its memory.
-- http://mail.python.org/mailman/listinfo/python-list