KBM takes up 572% CPU

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.

Hi @JOkere,

Just some anecdotal remarks relative to KM and CPU over the past year.

One thing I have learned with KM is the Control/Option/Command/Escape feature which simply kills a running script. (It does not kill the KM engine. If I see KM in a high CPU state, this fixes it. I use this once or twice a month. And I guess that if I have to, I can set up a kill timer in the scripts of interest.

I believe ALL my runaway CPU issues with KM are related to image recognition issues, probably stuck in a loop. I use image recognition fairly often, probably more often than I should. In general, I do find VERY useful, and I execute many KM scripts employing image recognition many times every day.

I also am always running Activity Monitor. (see attached image).

I have 16GB of RAM and drive 3 monitors. Even with 20 apps open, the computer just purrs along @ low CPU usage. If I see the icon flaring up with a lot of proc usage, I can quickly go and figure out why. KM sometimes is the culprit, but more times than not, there is another culprit.

2 Likes

It happened again (CPU 400%), and again was a find image problem.
Now, 2 years later, I can't find the menu item you are referring to. Where is it in the menu ?
thank you Peter

In the Keyboard Maestro status menu (the icon menu in the top right corner of the screen).

The Cancel submenu is near the bottom of the menu.

Everyone should have a "cancel all" macro. Mine looks like this:

image

2 Likes

I created the macro. thank you.