How to Generate a Memory Leak in the Keyboard Maestro Engine

@Sleepy, it seems you have really copied slightly wrong links.

But in the vicinity of the posts you have linked to I found some interesting statements by you and others:

[You, March 2018] perhaps once or twice per week I get into the situation where the KME is “not responding” and I notice it has grabbed 4.5-6 GB of RAM

and @peternlewis replying:

Most of the serious memory leaks in the past have been related to image searching

This was indeed around the same time as your memory issues with the Find Image action.


[You, March 2018] Javascript is ugly and when I make a little typo in my Javascript the KM engine hangs up and I have to Force Quit the KM Engine (with up to 8GB of memory assigned to it).

Is this still the case? This again was around the same time, but it seems to be completely non-related to any image actions.(?)


BTW, @JMichaelTX gave you a good tip here, concerning variables:

That makes me think you must have some KM Variables that are storing very large amounts of data, maybe even binary data. I suggest you review your KM Variables, and Named Clipboards, in the KM Editor Preferences, and delete everything that you don’t need. If you need to store large amounts of data then do so in files, NOT KM Variables or Named Clipboards.

Have you thoroughly checked your variables and clipboards? I’m asking because in your reply you only said that you have 450 variables and that you think that your largest variable is one with 500 lines of text.

In case you still have 450 variables, I really would thin them out. Maybe you have some variables that are consuming lots of memory because of some accidental loop in one of the macros. But with 450 variables it is not easy to keep the overview.


And in the same post (from March 2018) you said something very interesting:

this problem has been around for years, even on previous hardware before I got his iMac

So, this would mean that the issue has not only persisted through the Mojave update, but is/was also present on different machines(!)

Weird, or maybe not. Assuming you are migrating your Macro library between machines and OS (and KM) updates, this really makes me think that the problem lies somewhere in your macro collection…