I'm having a problem with releasing the memory of a dictionary in Python. I run the following check and followed the process memory usage:
a = dict()
for i in xrange(1000000):
a[i] = i
for i in xrange(1000000):
del a[i]
gc.collect()
the memory usage after running those lines is much higher than before. how can I release all of the memory? notice I don't want to delete the dict itself.
thanks.