A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-December/059236.html below:

[Python-Dev] When do sets shrink?

[Python-Dev] When do sets shrink?"Martin v. Löwis" martin at v.loewis.de
Thu Dec 29 01:03:51 CET 2005
Noam Raphael wrote:
> 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.

In this specific case, perhaps. malloc will typically return memory to
the system only if that memory is at the end of the heap. If there
is more memory after block to be released, it can't return the memory
block, because it won't punch a whole into the heap.

So as soon as you have more than one object, things become interesting.

Different systems use different, enhance strategies, of course. For
example, Linux glibc malloc will allocate "large" blocks through
mmap (instead of sbrk), such blocks then can be returned individually.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4