[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] (FWD) memory leak? P.S.



> Ok. This bug now has me baffled and irritated. I've spent the last
> three hours running windows python scripts and rebooting. Here is a
> minimal program that displays the bug:

thanks david. this is a huge tool i can use for finding this bug.
in the meantime i've got good news and i've got bad news.

the bad news, even with these examples are not demonstrating the
creeping death on my machine. i tried running both your versions
and both remained quick and my resource meter/system monitor
remained steady.

the good news is, the code rang a couple bells in my head and i
went to check some things out. first i noticed these 'infinite
loop' programs need a ctrl-c to break out of them. i thought things
might not be cleaning up proper on a KeyboardInterrupt, but a little
testing showed pygame was successfully shutting down cleanly on ctrl-c.

while looking through that part of the code, i did notice pygame was
never cleaning up the sdl timer threads. (DOH!) under windows SDL
is defintely using threads to manage the timers, so without proper
cleanup there is a good chance something was leaking from that.
the windows code is also trying to set some priorities on the timer
threads. i can imagine if a thread like that is never freed, if too
many are created the windows time slicer could get horribly munged.

i'm hoping-hoping-hoping that this timers issue has been causing the
creeping death problems. just importing pygame gets some timer stuff
started automatically, timer stuff that was never being released.
also the timers were added in between the 0.2 and 0.3 releases, which
would coincide with the time david mentioned he started seeing this
problem.

i've cleaned the timer stuff up and checked it back into cvs.
if you've got cvs already setup you can simply update your
code. there is also a cvs snapshot which is almost always up to
date with what is in cvs. you can grab that from
http://pygame.seul.org/ftp/pygame-cvs.tgz

for those of you seeing this problem, please try the latest version
of pygame from CVS, it may have the solution we need.

if results are still not good, please send in your system specs.
i still am not sure what types of machines are seeing this error.
it'd be best to see which OS, how much RAM, which directx version.


whew, i hope the problem is solved. if it sounds still troubled i'll
find some better tools for measuring a program's resource usage and
try running pygame under a better microscope.

die, creeping death, die!

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org