processing a Very Large file

Mike Meyer mwm at mired.org
Thu May 19 02:33:51 EDT 2005


DJTB <usenet at terabytemusic.cjb.net> writes:
> I'm not a Python memory specialist, but does del immediately release/free
> the memory to the OS? I thought it was impossible to let Python immediately
> release memory.

Unknown. Python relies on the C alloc/free routines for handling
memory. del may immediately free() the memory (I don't know), but that
doesn't mean it gets released to the OS. None of the implementations
of alloc/free I'm aware of ever give the memory back to the OS. They
store it in a data structure for internal reuse.

If you hang out in Unix OS support groups (I use to hang out on
questions at freebsd.org), you get used to seeing questions about "My
program freed up the memory, but the size didn't shrink. Why
not?". The above is the standard answer.

      <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list