On Oct 11, 2006, at 10:30 PM, Mike Orr wrote: > There seems to be a multiplicative effect with Durus: adding/removing > a string or collection: it has a significantly larger effect on memory > use than the size of the object itself. For instance, every record > has: > .name # unicode > .synonyms # list of unicode > The total number of characters in all names and synonyms is just under > 2 million. You might assume these multibyte characters use 4 MB total, > or maybe 8 MB max. However, changing the names to short numeric > strings and replacing the synonyms with an empty list lowers the > memory usage by 60 MB! This seems llike a Python issue more than a Durus one. I wonder, though, if you could save a lot of RAM by using intern() calls in a __setstate__() implementation. If you are using the names as keys in a BTree, there is another copy there, too, and there might be another chance to use intern() for some advantage.