I have dozens of scripts in Advanced flows. On an irregular basis, the Homey script app crashes with the error message “Exit Code: null, Exit Signal: SIGKILL”.
According to AI: “This happens in 99% of cases because the script consumes too much working memory (RAM) or keeps the processor (CPU) occupied for too long without interruption”.
How can I identify the cause of this error and in which script it occurs?
A script can start multiple instances, like, when it started while it wasn’t finished yet, it starts another instance.
Running too many instances causes excessive RAM usage.
You can check Insights Homeyscript Memory usage, for when it happens, this might point you to the suspect scripts.
(This is just to point to the graph, it’s not an example of destructive RAM peaks)
At 9:30 the Homey script app went down with a 40% CPU usage
The spike in CPU usage is due to the app starting back up again, it looks like it got killed because of a memory leak that caused the amount of RAM being used to slowly increase.
How could I identify which scripts are causing this memory leak? Some scripts are executed sequentially.
The number of combinations is too large to test each script individually. It is more likely the combination of scripts to be executed.
Or is a memory leak something that Athom needs to investigate?
Simply said: you can’t 
You have to do some guessing which scripts could be candidates for memory leaks. For instance, scripts that use timers (setTimeout/setInterval), callback functions (like event handlers, etc) or scripts that use globals a lot. And/or scripts that have been generated by “AI”, since LLM’s don’t understand the intricacies of running HomeyScript.
Doubtful, at least I don’t see why a combination of scripts could cause a leak where an individual script can’t.
It’s more than likely not an issue with the HomeyScript app itself.
I don’t think it’s a memory leak.
Like I already wrote, every running (instance of a) script increases Homeyscript’s RAM use, until it gets past a threshold at some point, and Homey kills it.
150MB RAM usage really is huge, here it’s around 116MB in general.
I’d first check scripts which wait for a value or input; these can have many running instances > which should be avoided as much as possible.
And I’d check on scripts which get executed very often (less than each minute or so).