Memory leak while looping

Aahz aahz at pythoncraft.com
Fri Apr 18 00:21:30 EDT 2003


In article <1020cbf8.0304171900.110a1675 at posting.google.com>,
Roger Hancock <roger_hancock at hotmail.com> wrote:
>
>Thanks for the help.  The xrange call solved my problem.  However, I'm
>still a little puzzled by the behavior I'm seeing with the range call.
> With my now better understanding of the range call, I would expect to
>see my function take a big chunk of memory until the function exited. 
>Instead, the function continues to grab more and more memory.  First,
>it takes most of my physical memory (256 MB) and then proceeds to eat
>up my swap memory.  Eventually my machine reboots.  Pretty impressive,
>huh?  Just imagine the damage I could do with 4 lines of code.

Please post the precise code you see doing this.  I'd suspect you've
probably got some kind of recursive function that's keeping the memory
alive.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?




More information about the Python-list mailing list