Read the statement by Michael Teeuw here.
Raspberry Pi Memory Loss
-
@evroom I’m using mmm-SystemStats to view it on the magic mirror, unless this is monitoring the memory wrong?
-
@dazza120
This modules uses thefree
command to determine memory usage.
It doesfree / total times 100 %
.
But free (the value) does not take into account the shared memory, cache and buffers used by the system.
It would be better to use theavailable
value.
This value tells you how much memory is available to start a new application.
Seeman free
for some more details.Modern Linux is making more and more advanced use of memory and swap techniques, making it more and more difficult to determine certain values.
-
@evroom
Innode_helper.js
you could change line 67.
Change $4 into $7.
Then observe if you see the same behavior. -
@evroom changed it thanks I’ll continue the test much appreciated
-
@evroom hi it’s still declining but a lot slower, I’ll let it continue and see if the mirror locks up if it reaches 0%
-
@evroom yeah it just died, MagicMirror crashed showing the black screen, when MacicMirror was restarted boom 80% free memory. So now I’ve got watchdog on for hopefully when it crashes it will restart with 80% memory
-
Have you tried running top or (htop if installed) from a terminal cli to see which process(es) are using up the memory?
-
Could you send the output of the following commands, when running more or less normal?
free swapon -s vmstat 5 10 top -b -o +%MEM | head -n 22
And the suggested htop command is also nice to look at.
Might need to be installed separately. -
@evroom restarted the hole thing so memory is good. i have no idea what this other thing is that you and @jsteel715 are talking about lol but here is what you asked for with the code. this is normal operation apart from chromium that is shutdown everytime im not using it
pi@raspberrypi:~ $ free total used free shared buff/cache available Mem: 3999788 509844 2834580 197580 655364 3197620 Swap: 102396 0 102396 pi@raspberrypi:~ $ swapon -s Filename Type Size Used Priority /var/swap file 102396 0 -2 pi@raspberrypi:~ $ vmstat 5 10 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 1 0 0 2833448 45296 610956 0 0 867 25 513 852 17 8 69 5 0 1 0 0 2830796 45304 613168 0 0 0 6 552 626 2 1 97 0 0 0 0 0 2835100 45312 609128 0 0 0 37 537 615 2 1 97 0 0 0 0 0 2836716 45320 609156 0 0 0 10 433 483 3 1 96 0 0 0 0 0 2836220 45320 609132 0 0 0 0 383 410 1 1 98 0 0 0 0 0 2833132 45328 609768 0 0 0 23 308 329 2 1 96 0 0 0 0 0 2833684 45328 609136 0 0 0 32 502 528 1 1 98 0 0 0 0 0 2839432 45328 602188 0 0 1 2 1054 1883 6 4 90 0 0 0 0 0 2830820 45336 609832 0 0 9 13 1684 2816 18 6 76 0 0 3 0 0 2825096 45344 615684 0 0 0 11 1597 2651 19 5 76 0 0 pi@raspberrypi:~ $ top -b -o +%MEM | head -n 22 top - 19:50:21 up 6 min, 2 users, load average: 1.35, 0.78, 0.38 Tasks: 159 total, 1 running, 157 sleeping, 0 stopped, 1 zombie %Cpu(s): 7.7 us, 3.8 sy, 0.0 ni, 88.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 3906.0 total, 2774.0 free, 502.4 used, 629.6 buff/cache MiB Swap: 100.0 total, 100.0 free, 0.0 used. 3131.1 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1452 pi 20 0 411492 145144 95428 S 0.0 3.6 0:37.40 chromium-+ 815 pi 20 0 537468 141332 82408 S 10.5 3.5 0:26.66 electron 905 pi 20 0 356568 114216 62964 S 0.0 2.9 0:13.56 electron 1155 pi 20 0 473740 99856 80016 S 0.0 2.5 0:11.76 chromium-+ 1484 pi 20 0 336364 74940 56704 S 0.0 1.9 0:02.31 chromium-+ 1201 pi 20 0 318296 74660 56632 S 0.0 1.9 0:18.70 chromium-+ 900 pi 20 0 301448 66488 48860 S 0.0 1.7 0:04.48 electron 494 root 20 0 151824 52472 37340 S 0.0 1.3 0:38.00 Xorg 1206 pi 20 0 266728 50416 38620 S 0.0 1.3 0:01.99 chromium-+ 539 pi 20 0 136068 44144 25440 S 0.0 1.1 0:01.74 PM2 v3.5.+ 1535 pi 20 0 286880 39344 31156 S 0.0 1.0 0:00.09 chromium-+ 728 pi 20 0 128372 37932 25488 S 0.0 0.9 0:00.98 npm 1176 pi 20 0 198328 34484 28812 S 0.0 0.9 0:00.17 chromium-+ 451 root 20 0 58952 33852 17416 S 10.5 0.8 0:28.86 vncserver+ 634 pi 20 0 149252 28832 22788 S 0.0 0.7 0:01.44 lxpanel pi@raspberrypi:~ $
-
Could you repeat this when memory usage has increased substantially?
The chromium processes are taking up quite some memory.
I myself have none running.Did you get the latest packages?
$ sudo apt-get update $ sudo apt-get dist-upgrade