[Python-Dev] When do sets shrink?

Noam Raphael noamraph at gmail.com
Thu Dec 29 00:51:08 CET 2005


On 12/29/05, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Noam Raphael wrote:
> > Should something be done about it?
>
> It's very difficult to do something useful about it. Even if
> you manage to determine how much memory you want to release,
> it's nearly impossible to actually release the memory to the
> operating system, because of the many layers of memory
> management software that all need to agree that the memory
> should be reused somewhere else (instead of keeping it on
> that layer, just in case somebody using that layer wants
> some memory).
>
I checked - when doing the same thing with lists, all the memory was
released for use by other Python objects, and most of it was released
for use by the operating system.

Noam


More information about the Python-Dev mailing list