sdetweil / MagicMirror_scripts

Magic Mirror installation and setup scripts
360 stars 64 forks source link

Memory issue after running update script #85

Closed beeperr closed 7 months ago

beeperr commented 8 months ago

Last year, you had fixed something in the install script that finally got me around the low memory issue that we realized came with my Model 3 A+. I tried running your update script for the first time today, and I'm getting some of the same problems. When I start MagicMirror now, it gets most of the way up and then restarts.

pm2 logs show the following:

0|MagicMir | <--- JS stacktrace ---> 0|MagicMir | 0|MagicMir | FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 0|MagicMir | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGABRT 0|MagicMir | 0|MagicMir | <--- Last few GCs ---> 0|MagicMir | 0|MagicMir | [6292:0x3d6f8000] 118694 ms: Mark-Compact 122.9 (129.1) -> 122.2 (128.6) MB, 451.85 / 0.00 ms (average mu = 0.763, current mu = 0.525) allocation failure; scavenge might not succeed 0|MagicMir | [6292:0x3d6f8000] 119222 ms: Mark-Compact 123.7 (129.8) -> 123.4 (129.8) MB, 473.96 / 0.00 ms (average mu = 0.635, current mu = 0.103) allocation failure; scavenge might not succeed 0|MagicMir | 0|MagicMir | 0|MagicMir | <--- JS stacktrace ---> 0|MagicMir | 0|MagicMir | FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 0|MagicMir | /home/pi/MagicMirror/node_modules/electron/dist/electron exited with signal SIGABRT

Any help would be greatly appreciated!

As an aside, I also use a custom compliments.js, and that appears to have been wiped in the update process.

sdetweil commented 7 months ago

on memory size

have to edit package.json and add

--js-flags=--max-old-space-size=8192 

like this on the "start" clause

 "start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron  --js-flags=--max-old-space-size=8192 
 js/electron.js",

8192 might be too big, 4096, 2048 are other choices

I also use a custom compliments.js, and that appears to have been wiped in the update process.

yes, NEVER edit our files.. you will lose your stuff, all config goes into config.js, all css in custom.css

{
module:"compliments"
position:"xx",
config:{
   compliments:[
        // put you list here 
    ]
}
}
beeperr commented 7 months ago

You've saved the day again. For the record, I had to bring it down to 2048 to get it to work.