[Python-Dev] When do sets shrink? (original) (raw)
Noam Raphael noamraph at gmail.com
Thu Dec 29 00:22:03 CET 2005
- Previous message: [Python-Dev] set.copy documentation string
- Next message: [Python-Dev] When do sets shrink?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] set.copy documentation string
- Next message: [Python-Dev] When do sets shrink?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]