KBM takes up 572% CPU

LOL. I think the bar for "genius" is slightly higher than that, but you're more than welcome. Glad I could help.

2 Likes

Generally, the only time you get high CPU usage out of Keyboard Maestro Engine is when it is searching the screen for an image (which is a highly computationally intensive task).

It will do this if you are executing a macro that requires this functionality (especially bad can be Pause Until since this will continuously check for the image). Check the Keyboard Maestro status Cancel submenu to see what macros are currently running, as well as the recently executed macros (select the All Macros group and sort the macros by macro execution).

If will also do this if there is an action editor displayed in the Keyboard Maestro editor which is live evaluating an expression involving searching the screen. Eg, an If Then Else action with a Screen Condition action. Since the displayed “(currently true)” or “(currently false)” condition is updated every second, even if the macro is not executing, if the condition is displayed in the Keyboard Maestro editor, it is still testing the screen.

Cancel the appropriate macros, add timeouts if necessary so they dont recur, and don’t leave the Keyboard Maestro editor displaying such an action (quit it, or undisclose the actions, or deselect the macro).

2 Likes

You are spot on: I had used a macro a few hours before, which was searching for an image.
thank you very much.
I created the macro because I have to fill in the same form (different URL every day) in which

  • I have to click on radio buttons
  • in Chrome
  • I have 3 radio buttons to click
  • the form is only one screen, but I have to page down once to complete it.
    I would like to automatize the procedure. I can’t send an image for privacy reasons.
    Would you have any KBM action suggestions?
    thanks very much

I've often wondered how to tell what macros are active, or what's run recently. If I had thought about it, I could have figured out the second part, but the first part is awesome. I never even noticed that menu item before.

1 Like

About once a week, KM takes off and runs very high CPU (Activity Monitor @ >200%). I kill KM and just restart it and it clears.

I have lots of KM macros I am running - Is there anyway to see which one might be causing it? For instance, if I force-kill the program, will that create a log file that might have useful info? I have KM so integrated right now, most of the time I do not even know I am using it.

You can use the action "Cancel all Macros" to terminate all active macros.

Then you can run this macro:

It will tell you the macros that have recently run, and the date/time when they ran. Look for anything suspicious. If it happens again, repeat the process. It won't take too long to find the culprit.

Hey Ed,

You’ve tried the Cancel All Macros action instead of killing Keyboard Maestro?

How exactly are you killing Keyboard Maestro?

You know the Keyboard Maestro Editor has a Quit Engine command? Force-Quitting should never be necessary (except in extraordinary circumstances).

You’ve looked in the Keyboard Maestro Status Menu > Cancel submenu to see what’s running?

Have you actually looked at Keyboard Maestro’s logs? (See Open Logs Folder in the Help menu.

You’ve gone to the All Macros group and sorted by Date Used?

-Chris

Chris,

  • activity monitor to kill
  • ok
  • no
  • no
  • no

Bottom line is no on all counts…

It was something that I just had not spent a lot of time on. But saw the
message board here and thought I would make the comment.

Let me run the list you provided to see if I can gain insight to what is
going on. If I figure it out, I’ll poste back. As always, appreciate the
guidance.

Ed

Hey Ed,

I've used iStat Menus for years to keep on top of what's happening with my System.

I can tell at a glance whether something unexpected is going on with CPU, memory, network input/output, disk activity, and battery.

I also use Keyboard Maestro's Iconaholic Loud icon to rapidly get my attention if KM is taking an unexpected amount of time to run a macro.

-Chris

Oh that is interesting. I use something called textbar.

I can set up various terminal commands and other functions.
30G is disk space, 0268 is a ping against Baidu.com, 0109 is a ping against
Google.com. I monitor those because i am in China and have to figure out if
my VPN is connecting to the US properly. It does a bunch of other things.
But I like the iStat view, looks like it beats staring at the Activity
Monitor Icon.

Many thanks.

  • Ed.

Read my post above:

Keyboard Maestro uses essentially no CPU, except when running a macro.

Hey Ed,

Textbar is slick for what it does.

iStat Menus is just on a whole other level for system monitoring.

All of the menus open to reveal significantly more information. Here's the CPU menu:

I just noticed that it's part of the MacUpdate.com Summer Bundle too.

I think the retail price is $18.00 U.S. for iStat Menus.

The MacUpdate bundle is $49.95 U.S. for 10 apps, but I already have too many of them for it to be a good investment.

-Chris

I’m trying out iStat now. Yeah, textbar does the one thing I really
needed… monitoring of my connections to the U.S. The Great Firewall is a
tough go so the ability to ping constantly (like every 2 or 3 seconds) to
monitor connections is great. iStat looks like a keeper so thanks for
that.

Ed

OK, 1 day with iStat and I am hooked. It’s also nice to see that the iStat app itself is not materially loading down my Macbook Pro. Textbar will continue to live though as I can monitor via ping multiple servers. Thanks again for the input.

Well, I ran the “last macros run” macro and it provided the log. I figured out that one of the applications that uses a lot of screen image recognition calls was broken and driving the CPU high and leaving it there. Is there a way to set a timeout specifically on the image recognition function?

With that said, the macro is called ZoomFocusToggle, and I’ll place it into the Macros section.

Thanks to all for the input.

You set a timeout on the actions using the facility if desired.

The find image facility itself does takes only a limited time, so it does not make sense for it to have a timeout. The issue of CPU usage occurs when the facility is used continuously, thus requiring a timeout at some higher level, at the action level.

OK… I have appeared to have tamed the issue. OK on the finite time for the “find image” facility. I will keep an eye out for further problems but appreciate the help.

Hi @radiator - how did you Resolve the 'find image' facility on your particular workflow - I used this on a couple of my workflow and do notice that CPU utilisation goes high after a while...

  • it does a standard check for this app or that

Maybe it is me, however I do not want to continually use iStats or Activity monitor as this uses unnecessary CPU in the background (though minimal) - (ie. I am using a laptop - not desktop)

Here it my workflow which uses to search images twice in #1 and #2.
I am not too sure how to configure so it searches for a particular input text box...

Wondering if it is even possible to say watch for CPU utilisation which if goes over 100% for KM and runs longer for > 1minute then restart KM.

I use dropbox, one drive for work and I have set schedulers so it turns it on in the morning, before I leave office and at night so it doesn’t drain the laptop battery (hence cautious re battery drains).

Read my initial answer, it has not changed, and is marked as the solution to the problem.

You need to put a timeout on your Pause Until actions.

I don't understand your macro at all though, it triggers when Cisco activates, and then performs actions only if Cisco is not running, which would never be the case when Cisco activates, so I presume something else is triggering this macro as well.

Nobody wants high CPU usage - you should never have high CPU usage with Keyboard Maestro unless you are actively asking it to do something hard. If this is "always" then the solution to this is to stop it from continously doing something hard.

You probably could, but this is a terrible idea. Why restart Keyboard Maestro just to cancel a macro which shouldn't be running in the first place. if the macro is running when you don't want it to be running, then resolve that using a timeout or otherwise.