Another script
It offers flow tags for memory usage. You can start a flow every hour and check the value and restart Homey if necessary.