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.

Homey Memory usage

edited November 2016 in Developers
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. 



«13

Comments

  • EmileEmile Administrator, Athom
    We're aware of this, and the next Homey version will have more detailed 'system' information + tools for us to trace where it comes from. 
  • Sadly for us, this issue does not seem to affect every Homey, which makes it very hard for us to trace it's origin. It would really help us to fix it sooner if we knew which apps or settings can cause Homey to do this. Any feedback on this subject is highly appreciated.
  • Alright, what kind of feedback are you looking for? At the moment I use apps from app store except Hue app (this is v2.0.0)
  • If everyone with this issue could post a screenshot of the system info page as above we can see which apps are in use. It maybe also useful for those people to remove apps to try and find out which ones are having effect on the system memory. 
  • I don't think that only showing the memory usage is enough to make an educated guess on what is going on. How many flows are used, how many devices are paired etc etc.
  • Agree things such as flows can easily be deselected which can rule these out but amount of devices and types of device is a bit more difficult. 
  • jjtbsomhorstjjtbsomhorst Member
    edited November 2016
    Just did a small test over here. 

    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.
  • Sadly for us, this issue does not seem to affect every Homey, which makes it very hard for us to trace it's origin. It would really help us to fix it sooner if we knew which apps or settings can cause Homey to do this. Any feedback on this subject is highly appreciated.

    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

  • freemem is not the problem, that's linux-memcaching... It's the odd growing of the preserved memory for the system.  For some reason the OS caches too much of the system-memory, there's a memory-leak. So not the total memory usage (this is always almost full) but the part taken by system...
  • Can you not sandbox the apps to cope with men leaks and/or reboot a part of the system OS to deal with bad mem allocations?
  • jjtbsomhorstjjtbsomhorst Member
    edited November 2016
    That is exactly what should be happening. All apps are in a sandbox and if they are using to much memory or CPU they are killed after couple of  'warning' calls. Don't think the system 'app' is bound to that.
  • Sadly for us, this issue does not seem to affect every Homey, which makes it very hard for us to trace it's origin. It would really help us to fix it sooner if we knew which apps or settings can cause Homey to do this. Any feedback on this subject is highly appreciated.
    Does this information help?
    Uptime 48 hrs.


  • Since one of my apps seemed to be using memory like crazy I've looking more into this in the last week. With the help of @JeroenVollenbrock I was able to install and run the heapdump module to look into possible leaks.

    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.
  • Seems my Homey memory leakage issue has been solved. After 24 no more System obesitas  B)


  • @hnijveen So obesity went into anorexia with a negative value of 30MB - don't know in which case you'd need to worry more...
  • lol, you got me worried again (but I  manage)
  • Negative MB's means your system is swapping... So actually not so good...
  • fiekfiek Member
    edited November 2016
    I have the same. Is that really a problem?

     I deliberately removed a bunch of apps that I am not going to use yet. So I will install more apps in the future.


  • fiekfiek Member
    edited December 2016
    I have now -122 MB under other. Can anyone tell me if this is a problem?


  • See the comment of Fire69 just above yours...
  • @RobinVanKekem ; Big difference between no so good and a problem. Ok.. What is the solution?
  • Based on the experience raising this issue, I can share with you that latest firmware and I think latest Hue app sw release solved my problems (memory obesity / anorexia). My Homey is very, very stable delivering a great startup experience using a mix of Hue, Zwave, IFTTT, ...
    I also do believe the system is not at all mature (as we can expect for now).
  • fiekfiek Member
    edited December 2016
    I am running latest firmware and latest apps, I have deleted some apps so  the section ''other' is now -55 mb. I wanted to post a screen shot but somehow I can't upload the file



  • fiekfiek Member
    edited December 2016
    bump

    [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


  • Nobody?
  • 22 free here and all good,   Zwave good,  433,  milight,  sonos mm 
  • @djesko thnx for your reaction. When you add up the individual memory usage is it also correct? 
  • Will do that soon,  
  • Hi all

    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?
Sign In or Register to comment.