On Tue, 2009-02-17 at 00:40 -0800, Chris Rebert wrote: > > > > 'gc.collect()' -- I believe, but I'm not the specialist in it. > > If I understand correctly, that only effects objects that are part of > a reference cycle and doesn't necessarily force the freed memory to be > released to the OS.
I believe that's correct. If the OP is worrying about memory usage then they should also be aware that there are lots of very clever things done pre-assigning and keeping hold of memory with python's in-built types to let them scale well that can be confusing when you're looking at memory usage. Basically malloc() and free() are computationally expensive, so Python tries to call them as little as possible - but it's quite clever at knowing what to do - e.g. if a list has already grown large then python assumes it might grow large again and keeps hold of a percentage of the memory. The outcome is that trying to reduce memory usage can change what data structures you should use - tupples use less space than lists, etc. Tim W -- http://mail.python.org/mailman/listinfo/python-list