MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Raspberry Pi Memory Loss

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    17 Posts 3 Posters 5.7k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • evroomE Offline
      evroom @evroom
      last edited by

      @evroom
      In node_helper.js you could change line 67.
      Change $4 into $7.
      Then observe if you see the same behavior.

      MagicMirror version: 2.30.0
      Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

      Test environment:
      MagicMirror version: v2.30.0
      Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
      Raspbian GNU/Linux 12 (bookworm)

      D 3 Replies Last reply Reply Quote 1
      • D Offline
        dazza120 @evroom
        last edited by

        @evroom changed it thanks I’ll continue the test much appreciated

        1 Reply Last reply Reply Quote 0
        • D Offline
          dazza120 @evroom
          last edited by

          @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%

          1 Reply Last reply Reply Quote 0
          • D Offline
            dazza120 @evroom
            last edited by

            @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

            evroomE 1 Reply Last reply Reply Quote 0
            • J Offline
              jsteel715
              last edited by

              Have you tried running top or (htop if installed) from a terminal cli to see which process(es) are using up the memory?

              1 Reply Last reply Reply Quote 0
              • evroomE Offline
                evroom @dazza120
                last edited by evroom

                @dazza120

                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.

                MagicMirror version: 2.30.0
                Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                Raspbian GNU/Linux 12 (bookworm)

                Test environment:
                MagicMirror version: v2.30.0
                Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                Raspbian GNU/Linux 12 (bookworm)

                D 1 Reply Last reply Reply Quote 0
                • D Offline
                  dazza120 @evroom
                  last edited by

                  @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:~ $ 
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • evroomE Offline
                    evroom
                    last edited by

                    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
                    

                    MagicMirror version: 2.30.0
                    Raspberry Pi 4 Model B Rev 1.5 (8 GB RAM)
                    Raspbian GNU/Linux 12 (bookworm)

                    Test environment:
                    MagicMirror version: v2.30.0
                    Raspberry Pi 3 Model B Plus Rev 1.3 (1 GB RAM)
                    Raspbian GNU/Linux 12 (bookworm)

                    D 1 Reply Last reply Reply Quote 0
                    • D Offline
                      dazza120 @evroom
                      last edited by dazza120

                      @evroom said in Raspberry Pi Memory Loss:

                      $ sudo apt-get update
                      $ sudo apt-get dist-upgrade

                      ok 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.

                      1 Reply Last reply Reply Quote 0
                      • D Offline
                        dazza120
                        last edited by

                        @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:~ $ 
                        
                        
                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 2 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Sam, technical setup by Karsten.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy