[python-win32] Re: win32process open-terminate loop cripples OS

Roger Upole rwupole at msn.com
Wed Mar 22 02:24:36 CET 2006


David S wrote:
> Hello,
> 
> I decided to attempt to use python's win32 extensions as a method to
> monitor and control process for my python application.  It's working
> well in the short term, but, as this app is intended to be very
> low-maintenance, and probably high-uptimes without restarting, I want to
> put it to the test.  I set a loop similar to below to run every second
> for the weekend.  It wasn't very pretty.  I didn't get any process
> information (couldn't - system was /almost/ unresponsive) - the most i
> could do was alt-tab around, though it wouldn't paint the window, move
> the mouse pointer and turn the num lock light on and off.  Can anyone
> provide some guidance or perhaps point out a problem in my code?
> 
> For what it's worth, I think I can poll process /ad infinitum/ without
> any lockups.
> 
> Thank you,
> 
> -David S.
> 
<code snipped>

It's hard to diagnose without seeing all the code, but it
sounds like you might be running out of memory.  Are you
printing a lot of output that could be bloating the screen buffer ?
Also, you might want to check that all the handles you open
are closed properly.  The ones created as PyHANDLEs will
be closed automatically, but plain int handles won't be.

     hth
           Roger




More information about the Python-win32 mailing list