KiwiMonitor.com

Kiwi tools support Forum
It is currently Sun Mar 29, 2020 9:34 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Mar 02, 2016 2:06 am 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
Hey All,

I bought a copy of KAM Pro so I could use it to automatically quit Microsoft Outlook 2016 whenever it starts exceeding a certain threshold of CPU usage (Left unchecked, Outlook ends up using 90% of my Core i7 by the end of perhaps two or three hours). In a perfect world, the process would go something like this:

    Outlook exceeds 20% of CPU
    KAM kills Outlook
    KAM launches Outlook

I'm having two problems with this. First, while I found and configured the "This app: CPU Load is above XX%" rule and saved it, it doesn't seem to have any effect on Outlook, which continues to chug along merrily at 85 or 90% CPU. Second problem is how to get Outlook to launch again without KAM launching it every time Outlook quits, even if I myself am the one doing the quitting. If I enable the basic rule "When it ends, execute the application:" then Outlook relaunches no matter what. Is there a way to insert a condition to the effect of "If the program is shut down outside of the parameters set up in the rules, then do not relaunch"?

I'm sure I could spend a couple of hours pawing through the manual and eventually figure this out (if it is in fact even possible), but I thought I'd take the coward's way out and ask the experts. Any help you can give me would be appreciated!


Thanks in advance,

Andrew


Top
 Profile  
 
PostPosted: Thu Mar 03, 2016 9:57 am 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
Hello Andrew,

Attaching a picture of a simple set of rules that should do the job.
The closing and starting actions are in the same line, so Outlook doesn't get started if you manually close it.

You can also check if the CPU load gets recorded for Outlook (statistics => CPU load). Some apps need elevated rights for this (start as admin).
CPU loads are averages over a period of one minute, so Kiwi needs at least one minute to check.


Attachments:
1.jpg
1.jpg [ 287.68 KiB | Viewed 13946 times ]
Top
 Profile  
 
PostPosted: Thu Mar 03, 2016 12:39 pm 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
Kiwi Developer wrote:
Hello Andrew,

Attaching a picture of a simple set of rules that should do the job.
The closing and starting actions are in the same line, so Outlook doesn't get started if you manually close it.

You can also check if the CPU load gets recorded for Outlook (statistics => CPU load). Some apps need elevated rights for this (start as admin).
CPU loads are averages over a period of one minute, so Kiwi needs at least one minute to check.


Awesome, thank you so much! This not only helps me get this particular project off the ground, it gives me some context for building future scripts. Talk about customer service! :mrgreen:

—Andrew


Top
 Profile  
 
PostPosted: Fri Mar 04, 2016 7:14 pm 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
Hey There again,

I'm afraid that the solution does not appear to be working. Here is a screenshot of both my Application Monitor rule and Task Manager:

Attachment:
Capture.PNG
Capture.PNG [ 133.83 KiB | Viewed 13941 times ]


I'm also somewhat puzzled about the difference between CPU load recorded by KAM and by Windows. KAM's Statistics window records a very low CPU load my Outlook while Task Manager and Resource Monitor show something quite different:

Attachment:
Capture1.PNG
Capture1.PNG [ 91.17 KiB | Viewed 13941 times ]


Outlook's CPU usage continues to climb until I have to shut it down because it's causing everything to slow down. I'm sure I'm doing something wrong, but I don't know what it is.


Thanks in advance,

Andrew


Top
 Profile  
 
PostPosted: Fri Mar 04, 2016 7:49 pm 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
Okay, this is amusing: ten minutes after I posted my last message, Outlook did close on its own for the first time, no idea what happened. I still don't understand why KAM's idea of CPU load and Windows' seem so out of sync with each other, but at least there's progress! 8-)


Top
 Profile  
 
PostPosted: Fri Mar 04, 2016 10:10 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
Looks like the data is being recorded for only 1 CPU core. If you have 4 cores, is the recorded value * 4 approx. the real value?

Try reducing the threshold CPU load for closing outlook to 5% (4 times less) for now...until I find a solution/fix.


Top
 Profile  
 
PostPosted: Sat Mar 05, 2016 12:22 am 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
Thanks so much, will do! Regarding your question: it's hard to match up the Statistics record directly with the readout from procmon, but the Statistics record for today shows a maximum CPU load spike of 13.3%:

Attachment:
Capture2.PNG
Capture2.PNG [ 40.66 KiB | Viewed 13941 times ]


Also, as an additional data point, while Outlook does close when the CPU load reaches the current parameter for closure, Outlook does not then subsequently reopen, even though the log records that it has been launched. Could this possibly be due to the time it takes for Outlook to completely shut down? The final folder sync during the shutdown procedure takes quite a long time, possibly as much as 45 seconds. Could the part of the task devoted to restarting Outlook be timing out? Totally talking over my head, here, so feel free to ignore my theories. ;)

EDIT: The processor is a six-core i7 5820K.


Top
 Profile  
 
PostPosted: Sat Mar 05, 2016 1:10 pm 
Offline
Site Admin
User avatar

Joined: Mon Jan 16, 2012 11:35 am
Posts: 110
Yes, you're right. In this case these rules aren't helping. We need to put the closing action on a separate branch, so that Outlook has time to close.

But under this circumstances outlook will be launched even when you close it.
You could fix this with the use of variables: when Kiwi closes outlook it sets a global numeric variable to 1. When checking for this variable later, it knows when Outlook was closed by Kiwi.

Attached a pic of the new rules


Attachments:
Untitled-1.jpg
Untitled-1.jpg [ 127.49 KiB | Viewed 13941 times ]
Top
 Profile  
 
PostPosted: Mon Mar 07, 2016 7:06 pm 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
That looks like exactly what I was hoping for. Again, thank you for your excellent customer support!


Top
 Profile  
 
PostPosted: Mon Mar 07, 2016 11:58 pm 
Offline

Joined: Wed Mar 02, 2016 1:37 am
Posts: 8
Hi, sorry to be a pest, but the rule set you had me create seems to result in KAM attempting to launch Outlook once per minute after the first time it kills the application due to CPU load. Here's the rule set as I entered it in KAM:

Attachment:
Capture.PNG
Capture.PNG [ 89.02 KiB | Viewed 13938 times ]


I've been trying to parse the logic behind the rules but given my Liberal Arts background I'm not getting much of anywhere. :?

Any suggestions? Thanks again!


Andrew


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group