ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-dev
python-dev
[Python-Dev] When do sets shrink?
by Noam Raphael other posts by this author
Dec 28 2005 3:22PM messages near this date
Re: [Python-Dev] suggestion for smarter garbage collection in function of size (gc.set_collect_mem_growth(2)) | Re: [Python-Dev] When do sets shrink?
Hello,

If I do something like this:

s = set()
for i in xrange(1000000):
    s.add(i)
while s:
    s.pop()
gc.collect()

the memory consumption of the process remains the same even after the pops.

I checked the code (that's where I started from, really), and there's
nothing in set.pop or set.remove that resizes the table. And it turns
out that it's the same with dicts.

Should something be done about it?

Noam
_______________________________________________
Python-Dev mailing list
Python-Dev@[...].org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.c
om
Thread:
Noam Raphael
Noam Raphael
Fernando Perez
Raymond Hettinger
Raymond Hettinger
Noam Raphael
Tim Peters
Josiah Carlson
Raymond Hettinger
"Martin v. Löwis"
Fredrik Lundh
Noam Raphael
Josiah Carlson
Donovan Baarda
Fredrik Lundh
Noam Raphael
"Martin v. Löwis"
Adal Chiriliuc
1
Adal Chiriliuc
Raymond Hettinger
Donovan Baarda
Noam Raphael
Guido van Rossum
Noam Raphael
Josiah Carlson
"Martin v. Löwis"
Noam Raphael

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved