Jump to content

ProcessWaitClose & CPU usage


ItAuto
 Share

Recommended Posts

Hi everyone,

I'm wondering if anyone else is noticing abnormally high CPU usage while waiting on ProcessWaitClose.

I'm getting a range of 8-20% CPU usage by the AutoIt3 process while it stops on that statement, and it's usually around 14%

This isn't too big of a deal, but it seems pretty excessive for a new Athlon X2 system and it's preventing my fans from dropping to their slowest setting. Page fault delta is about 50000 for the AutoIt process! I'm running Vista, Norton AV and Windows Defender (comes with Vista by default) - I would assume the problem arising from one of those things on my system. Any one else run into the same problem or figured out what is going on?

I read that ProcessWaitClose polls for the existence of the process every 250ms - is there a way to slow that down?

Thanks!

BTW, AutoIt and the process in question are being run from the same user account.

Edited by ItAuto
Link to comment
Share on other sites

if you want to slow it down you could make a udf

...

Ah, thanks, I wasn't thinking of a solution outside of ProcessWaitClose.

Does anyone else get that high CPU usage / page fault rate?

(If you want to check your page fault delta, from Windows Task Manager go to View -> Select Columns and check Page Fault Delta)

PF Delta of 50000 is huge, 20x anything else running on my computer...

Link to comment
Share on other sites

is the cpu usage still as high with th emethid i gacve you above?

No, it's much lower, thanks!

What's odd is if I change the delay in your loop to 250ms, it still only uses 1-2% CPU and has page fault delta ~3500, so writing your own spin loop is more efficient than using the built-in function...

Does ProcessWaitClose use different Windows API call than ProcessExists or something?

Link to comment
Share on other sites

  • 3 weeks later...

No, it's much lower, thanks!

What's odd is if I change the delay in your loop to 250ms, it still only uses 1-2% CPU and has page fault delta ~3500, so writing your own spin loop is more efficient than using the built-in function...

Does ProcessWaitClose use different Windows API call than ProcessExists or something?

I've had this problem too - around 10-15% CPU utilisation which is way too high. The workaround works - but the function shouldn't chew up the CPU this way in the first place...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...