Followup : Huuuuge memory leak (third attempt)

Fredrik Lundh fredrik at pythonware.com
Mon Feb 19 09:08:04 EST 2001


jurgen.defurne at philips.com wrote:
> Since in the second version, the main loop sleeps long enough to make
> sure that the spawned script is finished before another one is released,

doesn't look like it's sleeping:

if len(sys.argv) == 1:
    while 1:
        # Doesn't matter if P_NOWAIT or P_DETACH, tried 'em both
        os.spawnl(os.P_DETACH, 'd:\\python20\\python', 'python', 'cron.py', 'check')
        # no sleep here
elif sys.argv[1] == 'check':
    pass

adding a time.sleep(0.2) makes it work better -- and after 10 minutes,
the main process hasn't grown a single byte on my box...

Cheers /F





More information about the Python-list mailing list