Vera's Usage Of Installed Memory (Memory Utilisation)

Hi

Using the search function I can see a number of posts on memory utilisation on Vera, and as I’d recently suffered with memory issues (not the personal kind :P) which affected my ability to save any any changes. The use of the installed memory by Vera continues to confuse/intrigue me …

So to help me with something - please could some people with SSH access to their Vera run the ‘top’ command and let me know what it’s says for /usr/bin/LuaUPnP process? I’m just curious if everyone (or anyone else) reports over 100%.

Is it different between the VeraLite and Vera3 ? It would be interesting to compare the two?

[b]Mem: 53384K used, 9096K free, 0K shrd, 1632K buff, 11192K cached
CPU: 14% usr 7% sys 0% nic 74% idle 2% io 0% irq 0% sirq
Load average: 0.14 0.19 0.26 1/98 3875

PID PPID USER STAT VSZ %MEM %CPU COMMAND
29605 1971 root S 121m 199% 11% /usr/bin/LuaUPnP[/b]

  • I have logging to USB set up, so please let me know how your logging is set up too.

[size=8pt]Whats also been interesting is running ‘free’ at the command line as it often suggests I have about approx 10000k free, but depending when you run it I’ve seen it as high as 15000k and as low as 4000k (without Vera doing much,) and I’ve also watched it continually reduce as it would move more and more mem over into the buffers )[/size]

That’s not good … you are out of memory! The Virtual Image size is greater than the physical memory size.
Parts of the image are paged out and have lost their memory, probably the stacks for some seldom used thread …
Stacks use a large amount of un-initialized memory when they are created. The unused part can be paged out without a backing store (Page File).
If some event causes those parts to page back in … the program will fault.
Note: Vera reserves two stacks/plugin. If some event (Timer, Vera Property Change, …) wakes up one of those stacks … that image is a gonner.
It’t can be considered the Running dead.

I an at 78% on Vera 3 … And consider my memory tight!

@parkerc
See the attached screenshot from my Vera 3.

Interesting. My Vera Lite has no issues and is not heavily loaded, but…

PID PPID USER STAT VSZ %MEM %CPU COMMAND
24048 2722 root S 63020 100% 1% /usr/bin/LuaUPnP

root@MiOS_xxxx:~# free -h
total used free shared buffers
Mem: 62480 45440 17040 0 0
Swap: 0 0 0
Total: 62480 45440 17040

Thanks @RTS

Everything seems fine and working well.

Is the /usr/bin/LuaUPnP process simply using virtual memory before writing to the USB storage?
Is there a predefined size or % difference between the physical and virtual memory?
If I have e.g. 10000k physical free, does it mean anything to the running if Vera?

From what you have said it sounds like I am just waiting for my Vera to fail ? (After which point I assume it will just reset the memory values and head blindly towards failure again ?)

Is this a vicious cycle or something that can be avoided?

Thanks @BrianLBeaton

Brian - please could you share the view of top to show the utilisation for /usr/bin/LuaUPnP process?

Thanks @z-waver

I’m curious if I’m alone in this, and I’d only just found the ‘top’ command
I had always used ‘free’ and assumed all was OK.

@Z-Waver
You are the Running dead as well.
Stacks use a lot of Virtual memory … but seldom use it … When they do … they must be backed by real physical memory.
Trivial plugin’s may only use a few pages of their reserved stack. Other plugins (i.e. those that use network resources) can use a lot of the stack. Recursive algorithms can use a lot of stack space.

If you want to make sure your Vera Never faults for lack of memory the sum of the memory size for ALL running processes should be less than 100, unless you have a paging file setup on your Vera. Then the sum of all memory must be less than the sum of Physical Memory + PageFile Size.
But performance can go to hell … if you actually page many pages in/out of the PageFile.

The fact that you have free memory … means that all of the Virtual Memory is NOT backed by physical memory … (i.e. uninitialized pages, or pages that are backed by code from a program).

Simple static analysis will not provide you much insight into potential problems. When the free memory count goes to zero … you image will fault.
Free memory can be consumed by other programs on Vera (chron jobs, Web requests, programs that people call via io.execute, …). If you do not have a USB stick, then the /tmp file space also uses this free memory.

[code]root@MiOS_<>:~# top
Mem: 106180K used, 21276K free, 0K shrd, 17636K buff, 23332K cached
CPU: 83% usr 8% sys 0% nic 0% idle 0% io 0% irq 8% sirq
Load average: 0.44 0.62 0.60 2/125 29320
PID PPID USER STAT VSZ %MEM %CPU COMMAND
11309 4222 root S 181m 146% 67% /usr/bin/LuaUPnP

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
root@MiOS_<>:~# free -h
total used free shared buffers
Mem: 127456 107052 20404 0 17636
Swap: 0 0 0
Total: 127456 107052 20404[/code]

I have logging to USB set up.

Hi Richard - perhaps you could let us know what your Vera reports? My Vera 3 reports 101%.

I did … it’s 78% … And I consider my Vera Max-ed out.

@RichardTSchaefer - I understand what you are saying and agree with you. But, even immediately after a reboot, LuaUPnP immediately goes to 100% and I have even more free memory. But, when I look at the System Monitor app, it reports almost 2 times as much free memory as the free command.

This system is definitely underutilized and had been trouble free for its 66 day uptime.

I found the reporting of this app to be wrong, it would always show me around 28000k available to me - but when I would run ‘free’ it would report as low as 4000k.

Arhh yes Richard - I see you have. Looks like a lot of Zombie Veras out there however. ::slight_smile:

This is why I hope the NEXT Vera has a LOT more memory!

It is early 2014, and Vera 3’s and Vera Lite’s all over the world may be dying from plugins that reserve two stacks per plug-in such as the PLEG (pronounced like plague) that seems to be spreading at an accelerated rate thanks to Rex’s recent release of PLEG Basics. :wink:

This thread, so far, reads like the exposition and rising action for a new story named “The PLEG of the Zombie Veras.” I am looking forward to the turning point (i.e. the climax), the falling action and the resolution of this thread hopefully in 2014.

More like early 2013 :wink:

Hi

If anyone else reading this with SSH access to their Vera.

Please can you run the ‘top’ command and share their results for /usr/bin/LuaUPnP process.

I would appreciate your help in gathering some more data to see if everyone (at least with a VeraLite) see this process running at over 100%?

I’ve seen it as high as 217%

Veralite:

Mem: 48444K used, 14036K free, 0K shrd, 0K buff, 20560K cached
CPU:   2% usr   5% sys   0% nic  91% idle   0% io   0% irq   0% sirq
Load average: 0.27 0.17 0.18 2/91 27535
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
 1456  1795 root     S    98168 157%   1% /usr/bin/LuaUPnP
 1704     1 root     S      748   1%   0% /usr/bin/luci-bwc

Vera 3:

Mem: 62152K used, 65304K free, 0K shrd, 2408K buff, 24256K cached
CPU:   5% usr   7% sys   0% nic  86% idle   0% io   0% irq   0% sirq
Load average: 0.29 0.21 0.16 1/94 7262
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
  864  2084 root     S     100m  81%   1% /usr/bin/LuaUPnP
  • Garrett

root@MiOS_3:~# free -h
total used free shared buffers
Mem: 127456 81340 46116 0 8416
Swap: 0 0 0
Total: 127456 81340 46116

FYI, This is my Vera 3

Vera Lite

Mem: 40652K used, 21828K free, 0K shrd, 4952K buff, 13772K cached
CPU: 0% usr 9% sys 0% nic 90% idle 0% io 0% irq 0% sirq
Load average: 0.21 0.18 0.16 1/73 25691
PID PPID USER STAT VSZ %MEM %CPU COMMAND
11963 2923 root S 50264 80% 0% /usr/bin/LuaUPnP

Three VeraLites:

VeraLite #0
Plugins: dataMine, Wunderground, Ping, Variable Container, Virtual Switch, Event Watcher, Netatmo, MiOS updater, Denon
Zwave devices: zero, but machines 1 and 2 are bridged to this one

Mem: 52812K used, 9668K free, 0K shrd, 0K buff, 21520K cached
CPU:   2% usr   5% sys   0% nic  91% idle   0% io   0% irq   0% sirq
Load average: 0.31 0.27 0.24 1/82 14911
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
 1832  1784 root     S    81952 131%   1% /usr/bin/LuaUPnP

VeraLite #1
Plugins: Virtual Switch, Event Watcher, MiOS updater
Zwave devices: 44

Mem: 49232K used, 13248K free, 0K shrd, 0K buff, 24260K cached
CPU:   4% usr   4% sys   0% nic  90% idle   0% io   0% irq   0% sirq
Load average: 0.25 0.18 0.15 1/67 12974
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
29003  1784 root     S    56980  91%   1% /usr/bin/LuaUPnP

VeraLite #2
Plugins: Variable Container, Virtual Switch, Event Watcher, MiOS updater
Zwave devices: 14

Mem: 44732K used, 17748K free, 0K shrd, 0K buff, 23640K cached
CPU:   4% usr   5% sys   0% nic  89% idle   0% io   0% irq   0% sirq
Load average: 0.24 0.16 0.15 1/70 17170
  PID  PPID USER     STAT   VSZ %MEM %CPU COMMAND
30789  1784 root     S    55376  88%   1% /usr/bin/LuaUPnP

VeraLites #1 and #2 run forever, #0 restarts itself every couple of days…
…draw your own conclusions.