Script application is hanging

I am running a homeyscript, approx 300 lines of code. I can see in the memory and cpu insight of the script application that these are increasing over time until the entire homeyscript app is hanging and I need to restart. Any ideas how to overcome this? Feels dreastic to restart the script app every hour.

Your LLM is hallucinating.

Maybe it’s possible to upgrade the library here?

Maybe npm install homey-api@latest will work here?