Sign in to follow this  
Followers 0
ItAuto

ProcessWaitClose & CPU usage

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
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
Sign in to follow this  
Followers 0