Freeing memory from Python lists!

Chris Spencer clspence at one.net
Wed Jul 11 21:53:06 CEST 2001


	I can confirm these results.  Why would a deleted list retain 90% of its
memory usage after being deleted?  Sounds like a pointer is getting lost
somewhere.

Chris.

On 11 Jul 2001 11:41:25 -0700, msimpson at ioindustries.com (Mike Simpson) wrote:

>I can't figure out how to free the memory used in the creation of a
>large list in Python.
>I am running the Python 2.1 interpreter on Windows 2000 Professional
>to run the following piece of code:
>
>result = []
>for count in xrange(510*478):
>	result.append(count)
>del result
>
>By using Windows Task Manager I was able to determine that 4332K of
>memory was used up until the end of the for loop, but only 960K of
>memory was returned to the system after the call to "del".  Is there
>any way to return the other 3372K of memory to the system without
>quitting the Python interpreter?
>
>Any help would be greatly appreciated.
>
>
>
>Mike




More information about the Python-list mailing list