Read the statement by Michael Teeuw here.
Raspberry Pi Memory Loss
-
@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
-
@evroom said in Raspberry Pi Memory Loss:
$ sudo apt-get update
$ sudo apt-get dist-upgradeok so ive done the apt-get update before so not much but dam the apt-get dist-upgrade took about 10mins or so. I just turned off the chromium run in the background even when it is closed and the use accelerated hardware.
-
@evroom this is how the mirror runs normally no other processes than this.
pi@raspberrypi:~ $ free total used free shared buff/cache available Mem: 3999788 376340 3175032 110328 448416 3418840 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 0 0 0 3176112 44568 402592 0 0 789 17 431 701 11 7 76 6 0 0 0 0 3175952 44568 403184 0 0 0 2 263 276 1 1 97 0 0 0 0 0 3174436 44568 403332 0 0 0 1 255 239 2 1 97 0 0 0 0 0 3174572 44576 402708 0 0 0 3 289 291 1 2 97 0 0 0 0 0 3174476 44576 402708 0 0 0 0 333 338 1 2 97 0 0 0 0 0 3175072 44576 402708 0 0 0 0 237 236 2 1 97 0 0 0 0 0 3173972 44576 402708 0 0 0 0 303 307 2 2 97 0 0 1 0 0 3172272 44576 403184 0 0 1 0 342 374 2 2 97 0 0 1 0 0 3172448 44584 404204 0 0 0 3 293 288 4 2 94 0 0 0 0 0 3172144 44584 404196 0 0 0 2 274 259 1 2 97 0 0 pi@raspberrypi:~ $ top -b -o +%MEM | head -n 22 top - 21:30:36 up 2 min, 2 users, load average: 0.27, 0.25, 0.10 Tasks: 162 total, 1 running, 160 sleeping, 0 stopped, 1 zombie %Cpu(s): 4.4 us, 1.5 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 3906.0 total, 3097.4 free, 370.0 used, 438.7 buff/cache MiB Swap: 100.0 total, 100.0 free, 0.0 used. 3336.5 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 814 pi 20 0 537468 140148 82128 S 0.0 3.5 0:17.93 electron 904 pi 20 0 356056 111640 62768 S 0.0 2.8 0:12.55 electron 899 pi 20 0 303116 67132 49136 S 0.0 1.7 0:06.92 electron 493 root 20 0 151288 51768 37196 S 6.2 1.3 0:05.34 Xorg 537 pi 20 0 136076 43848 25392 S 0.0 1.1 0:01.72 PM2 v3.5.+ 702 pi 20 0 127868 37380 25404 S 0.0 0.9 0:00.99 npm 439 root 20 0 78344 34092 17460 S 6.2 0.9 0:06.21 vncserver+ 807 pi 20 0 86380 28656 23016 S 0.0 0.7 0:00.19 node 610 pi 20 0 157416 28516 22584 S 0.0 0.7 0:01.23 lxpanel 1153 pi 20 0 85700 28048 22108 S 0.0 0.7 0:00.76 lxterminal 816 pi 20 0 139544 25756 19504 S 0.0 0.6 0:00.10 electron 611 pi 20 0 83220 21764 17288 S 0.0 0.5 0:00.79 pcmanfm 605 pi 20 0 62252 14620 12332 S 0.0 0.4 0:00.30 openbox 677 pi 20 0 31400 14188 12644 S 0.0 0.4 0:00.11 vncserver+ 664 pi 20 0 31772 12832 10560 S 0.0 0.3 0:00.42 vncserver+ pi@raspberrypi:~ $
-
@evroom this is it at 60% just running the mirror
pi@raspberrypi:~ $ free total used free shared buff/cache available Mem: 3999788 1191448 1723096 363156 1085244 2410100 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 0 0 0 1724372 83516 1000540 0 0 1 2 37 10 8 4 88 0 0 0 0 0 1722544 83516 1000824 0 0 0 0 357 423 1 1 98 0 0 0 0 0 1722348 83516 1000652 0 0 0 5 226 217 1 1 98 0 0 0 0 0 1723448 83516 999932 0 0 0 0 261 277 1 1 97 0 0 0 0 0 1723164 83516 1000676 0 0 0 0 247 249 1 1 98 0 0 4 0 0 1725856 83520 1000652 0 0 0 2 443 310 56 1 43 0 0 0 0 0 1736892 83520 1000652 0 0 0 0 419 319 39 2 59 0 0 0 0 0 1735444 83520 1002136 0 0 0 0 245 260 1 1 97 0 0 0 0 0 1735384 83520 1002136 0 0 0 0 296 356 1 2 97 0 0 0 0 0 1735408 83520 1002136 0 0 0 1 270 283 1 1 98 0 0 pi@raspberrypi:~ $ top -b -o +%MEM | head -n 22 top - 04:48:48 up 1 day, 7:21, 2 users, load average: 0.69, 0.75, 0.70 Tasks: 151 total, 1 running, 149 sleeping, 0 stopped, 1 zombie %Cpu(s): 18.9 us, 8.1 sy, 0.0 ni, 73.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 3906.0 total, 1694.7 free, 1151.2 used, 1060.1 buff/cache MiB Swap: 100.0 total, 100.0 free, 0.0 used. 2365.6 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 904 pi 20 0 1382888 1.1g 313184 S 38.9 28.4 330:15.93 electron 814 pi 20 0 790640 152908 83008 S 0.0 3.8 247:27.16 electron 899 pi 20 0 309132 69832 49136 S 0.0 1.7 223:14.37 electron 493 root 20 0 152020 52524 37268 S 16.7 1.3 54:27.50 Xorg 537 pi 20 0 138800 43548 25412 S 0.0 1.1 0:13.47 PM2 v3.5.+ 702 pi 20 0 127868 37380 25404 S 0.0 0.9 0:00.99 npm 439 root 20 0 80140 36180 17492 S 11.1 0.9 0:53.80 vncserver+ 610 pi 20 0 157644 28832 22600 S 0.0 0.7 0:51.52 lxpanel 807 pi 20 0 86380 28656 23016 S 0.0 0.7 0:00.19 node 4608 pi 20 0 85108 27664 21924 S 0.0 0.7 0:00.62 lxterminal 816 pi 20 0 139544 25756 19504 S 0.0 0.6 0:00.10 electron 611 pi 20 0 83220 21764 17288 S 0.0 0.5 0:00.91 pcmanfm 677 pi 20 0 31400 14836 13292 S 0.0 0.4 0:00.25 vncserver+ 605 pi 20 0 62488 14620 12332 S 0.0 0.4 0:00.51 openbox 664 pi 20 0 31772 12832 10560 S 0.0 0.3 0:01.06 vncserver+ pi@raspberrypi:~ $
-
So it is an electron process, hence MM process, alright.
Now find a way how to determine which module is causing this.
Which modules do you have active? -
Can you do following ?
Please do not post output that is very long.
Just want to get a feeling if these commands lead to anything, hence the MMM module eating memory$ top -b -o +%MEM | head -n 8 $ strace -T -o /tmp/strace.out -p PID_from_top_command After about 15 seconds, use control-c to stop strace. For example: $ strace -T -o /tmp/strace.out -p 904 $ grep 'name_of_MMM_module' /tmp/strace.out For example: $ grep 'mmm-systemtemperature' /tmp/strace.out $ grep 'name_of_MMM_module' /tmp/strace.out | wc -l For example: $ grep 'mmm-systemtemperature' /tmp/strace.out | wc -l