This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Homey Memory usage
When I monitor the system information memory page I noticed that the system part grows almost with almost 300% within 40 hours. Seems to me a bit steep.
Comments
I have 9 flows and 6 kaku devices. After a reboot Homey system uses around 90 megabytes of memory. When I switch on and of 1 kaku device using the build in lights trigger this usage jumps to 126 megabytes. Ofcourse this memory is reserved memory and not actual used memory.
But ofcourse this memory gets cleaned up so 1 minute after the last command the memory usage jumps to 110 megabytes.
OK, then here are my apps. I have the same problem. The amount of free mem is decreasing due to the system taking more mem by time. I only have these apps running and free mem is only at 27.99MB (was more)
I am running 0.10.7
Uptime 48 hrs.
Although there are some leaks (e.g. `savingCallbacks` in my case related to `saveHomeySettings`) it is also related to the incremental garbage collector that will not directly free up all memory. Some memory is only freed when it really runs out of memory and runs a full garbage collect. I had to rewrite my app code to make sure it was easier to GC.
As in the example mentioned above, memory leaks often occur with callback and closures, which Homey uses a lot. A nice article about this is https://blog.appdynamics.com/nodejs/understanding-node-js-memory-leaks/. BTW: I can recommend Athom to use a tool like AppDynamics to get a good view on what is going on internally (it has a 30-day free trial ).
Another ting to try is using a module like 'idle-gc' (or just running node with '--expose-gc' and forcing GC with 'global.gc()').
For developers that want to debug memory usage, have a look at how I've added it one of my apps: https://github.com/nlrb/com.weather-sensors/tree/AlectoV1. Be careful not to make heap dumps to often and it can also take quite some time to get the dump data from the back-end to the front-end.
[edit] ..Can anyone tell me this maybe is the cause of some instability issues I have? Also the 23 mb free memory that is displayed is not correct when I add up all memory used by the apps. It's about 562 mb
Noticed today that the "Other" memory usage is growing everyday that looks to a memory leak to me. This is the result after 68hrs:
It is not causing problems as of yet but it can not grow endlessly in my view without causing some problems in time.
Is anyone else experiencing this?