Python memory handling

Chris Mellon arkanes at gmail.com
Thu May 31 13:10:07 EDT 2007


> Like:
> import pool
> pool.free()
> pool.limit(size in megabytes)
>
> Why not letting the user choosing that, why not giving the user more
> flexibility ?
> I will try later under linux with the latest stable python
>
> Regards,
> FP
>

The idea that memory allocated to a process but not being used is a
"cost" is really a fallacy, at least on modern virtual memory sytems.
It matters more for fully GCed languages, where the entire working set
needs to be scanned, but the Python GC is only for breaking refcounts
and doesn't need to scan the entire memory space.

There are some corner cases where it matters, and thats why it was
addressed for 2.5, but in general it's not something that you need to
worry about.



More information about the Python-list mailing list