I’m getting a lot of KM Engine log entries like these, that all say some KM variable has been excluded from environment to ensure the environment is not too large:
3/6/17 8:09:25.096 PM Keyboard Maestro Engine[33485]: Variable “KMVAR_Result” excluded from environment to ensure the environment is not too large
3/6/17 8:09:25.096 PM Keyboard Maestro Engine[33485]: Variable “KMVAR_Results_HTML” excluded from environment to ensure the environment is not too large
3/6/17 8:09:25.096 PM Keyboard Maestro Engine[33485]: Variable “KMVAR_Variable” excluded from environment to ensure the environment is not too large
3/6/17 8:09:30.460 PM Keyboard Maestro Engine[33485]: Variable “KMVAR_Result” excluded from environment to ensure the environment is not too large
3/6/17 8:09:30.460 PM Keyboard Maestro Engine[33485]: Variable “KMVAR_Results_HTML” excluded from environment to ensure the environment is not too large
3/6/17 8:09:30.460 PM Keyboard Maestro Engine[33485]: Variable “KMVAR_Variable” excluded from environment to ensure the environment is not too large
This concerns me because:
I don’t really understand what it means
I don’t know the impact of excluding, or NOT excluding these variables
I don’t know what I should do about it, if anything.
@peternlewis, can you please enlighten me, and perhaps others?
Sure. The “environment” in a unix machine is the set of environment variables that a process has (having just been through this a bit with the Execute Shell Script, you’re probably sick of hearing about environment variables by now!).
Keyboard Maestro puts its variables into environment variables when executing a script to allow for easy access to them (access directly without having to go via AppleScript to the Keyboard Maestro Engine).
However Keyboard Maestro can have any size, but the total size of the environment variables is limited to something. It’s not well documented as far as I am aware, and not necessarily unchanging, but basically 256KB is about the limit usually.
And if the environment is bigger than that, then the script simply will not execute at all. Which would mean in Keyboard Maestro’s case, if the total size of your variables exceeds a size of around 256KB, all script actions would stop working.
So Keyboard Maestro defends against this by excluding the largest variables until the size is well less than 256KB.
You are seeing those messages in the log because of that. Presumable those variables quoted hold large amounts (relative to 256KB anyway), and thus are excluded from the environment.
Other than your scripts not being able to access those variables, and the log entries themselves, there is no negative consequences.
Note to self (and maybe others): Be more diligent in clearing/deleting KM Variables at the end of my Macros, and, periodically, clear out all non-“permanent” variables (for me that means those that do not start with “DND__”)