processing a Very Large file

Gregory Bond gnb at itga.com.au
Thu May 19 02:58:44 EDT 2005


Mike Meyer wrote:

> 
> 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.
>
... and in any serious OS, if memory is not reused it will eventually 
page out anyway, so the total cost of not releasing the memory back to 
the OS is miniscule (an entry or two in a page table) and the benefit of 
releasing it basically nil[*], while the effort of working out whether 
memory can be released or not is possibly quite significant.

[* Excepting possible swap-space exhaustion, I suppose.]



More information about the Python-list mailing list