Garbage collection

Aahz aahz at pythoncraft.com
Wed Mar 21 18:25:42 EDT 2007


In article <slrnf0306k.1dh.nick at irishsea.home.craig-wood.com>,
Nick Craig-Wood  <nick at craig-wood.com> wrote:
>Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> wrote:
>>
>>  Or you could just have an "object leak" somewhere. Do you have any
>>  complicated circular references that the garbage collector can't resolve?
>>  Lists-of-lists? Trees? Anything where objects aren't being freed when you
>>  think they are? Are you holding on to references to lists? It's more
>>  likely that your code simply isn't freeing lists you think are being freed
>>  than it is that Python is holding on to tens of megabytes of random
>>  text.
>
>This is surely just the fragmented heap problem.

Possibly.  I believe PyMalloc doesn't have as much a problem in this
area, but off-hand I don't remember the extent to which strings use
PyMalloc.  Nevertheless, my bet is on holding references as the problem
with doubled memory use.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Typing is cheap.  Thinking is expensive."  --Roy Smith



More information about the Python-list mailing list