KM Issue, Very High CPU Usage

Hello!

Could someone please explain this issue?
No macros are running but CPU usage by KM is pretty high.

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 don't recur, and don't leave the Keyboard Maestro editor displaying such an action (quit it, or undisclose the actions, or deselect the macro).

You are right, that is exactly what i am doing BUT if i cancel all running macros so none of them are running then KM still using much of CPU, not sure why exactly it happens looks like it keeps searching for an image even if a macro is canceled.

Do you have the editor window open to an action that is updating its state?

Yes, it’s open

Does this apply:

Peter, if we "Stop Editing Macros" (disable editing) will that prevent the KM Editor from running these Actions, or all Actions actually?

Yes, or deselect the macro, or undisclose the action, or even scroll it off the screen. Anything so the “(currently whatever)” is no longer visible (well, the entire action has to be scrolled off the screen).

I came across this post when I search the internet.
I have a follow up question. In recent days I've experienced pretty frequently the slow down of my Mac and when it happens, the Windowserver CPU is high.
I checked and no macro was running.
I was editing macros, but most of them did not have a Screen Condition action. They do contain Variable condition though. Will variable condition slow down the Mac as well?
Thanks!

Try:

Thanks, Peter.
I already done everything, except "Displays have separate spaces".
when the computer becomes slow, I tried the following:

  1. close/quit most apps
  2. in KM choose other macros (no find screen condition)
  3. close KM.
  4. quit KM completely and restart.
    only the last step gets the computer back to normal speed, and it does not require me to quit other apps at all.
    I also tried rebooting. But as soon as I open KM and start editing macros for a while, the computer becomes slow again. this is essentially the same with quitting KM.

If Keyboard Maestro Engine itself is using high CPU, then use the Activity Monitor to sample the Keyboard Maestro Engine process to find out what it is doing and send it to support.

If the Window Server is high CPU until you quit Keyboard Maestro Engine, then I have no idea, since it is the Window Server doing whatever the Window Server wants to do and that isn't something I control.

1 Like

The latter was the case. For normal use in the background it won’t affect speed at all.
I have finished heavy creating&editing task. Therefore, it’s not bothering me now. I’ll report it if I notice any pattern in future.
Thanks!

1 Like

Ok. After editing a long macro I encountered the slow down again.
I quitted all other apps, but the problem still exist.
Everything is affected. When I scroll down in a macro or move a window, not only is it slow, the CPU (WindowServer) use would rise to an abnormal percentage. The slow down is not limited to operations in Keyboard Maestro. Everything is slowed down.

After I quit the Keyboard Maestro engine (not even the KM window), everything immediately becomes normal.
I've recorded a few seconds to illustrate the issue. I've uploaded a video to youtube.

Any suggestions?

1 Like

Unfortunately, no. I don't know what the Windowserver is doing, or why it is being so slow, or how that might be related to Keyboard Maestro Engine. Other than examining your macro and trying to determine what steps might induce the window server to behave badly, there isn't much else I can suggest.

The more macros need more CPU usage?

Hey Liang,

This is very vague.

Did you read Post #2?

-Chris

Now, I disable some macros to get a low CPU loading.

I disabled all my macros, then re-enabled them - this fixed the problem for me.

If Keyboard Maestro or Keyboard Maestro Engine is using lots of CPU (other than when it is actively working hard at something like OCR or finding images), then use the Activity Monitor utility to get a sample and send it to us (Stairways Software: Contact Us) and we can likely tell you why.

Usually there is a clear cause that is easily resolved. Sometimes it is just that the system is messed up, or some system cache or database is corrupted.

1 Like