Read the statement by Michael Teeuw here.
"Out of memory" issues - where do I begin?
-
@ember1205 s, I might try going thru each of the images u have adjusted with the electron browser on the pi and see what happens
from a commandline
cd ~/MagicMirror export DISPLAY=:0 pi@raspberrypi4:~/MagicMirror $ node_modules/.bin/electron file://{url to pic}
mine looked like (from my mounted server volume)
node_modules/.bin/electron file:///media/buildserver/media/Photos/DCIM/2018\ vacation/Page\ Arizona/DSC_0323.JPG
then close the browser, and use a different url
now… we are running electron 3.0.13, which is quite old…
you could try upgrading that to something newer… next version will use 6.0.12 (if my change is accepted) -
What would I be looking for?
-
@ember1205 the browser having trouble, crashing maybe
-
I used an iterative command for this because there are so many photos:
cd ~MagicMirror find < path to images >/* -exec node_modules/.bin/electron file:///{} \;
For each file in that directory, it would launch the electron browser and open the image. Because electron continues to run until it is terminated, this puts one image at a time on the screen. After each one loaded, I would simply click “X” to close the browser and it would move on to the next image.
While I -did- see one specific image file appear to load but not actually show any content (initially), I believe this may have been an issue with the fact that I walked away from the process for about ten minutes. Expanding the browser window caused it to re-render and it displayed fine. Additionally, this is an image that I have personally seen on the screen many times with no apparent link to any crashes.
It seems that any image-specific issues are possibly cumulative since loading each one in turn starts with a fresh memory allocation as the browser exits after each image.
-
Thought I would update this…
Still broken.
I have the latest MM as a fresh install on a brand new RPi with a new power adapter, using a brand new SDCard, connected to a different monitor, using a different HDMI cable, and it’s all plugged in to an outlet at an entirely different house in a different area of the state (different sections of the grid). I have the same few, basic modules installed and have added the photos module discussed here. It crashes and hangs randomly with “out of memory” errors just like the other one.
The only thing the same between the two is the photo collection. I’ve not found any consistency in the past on it failing with any specific photos so troubleshooting this seems like it’s going to be impossible.
-
@ember1205 debugging is indeed very difficult w these problems.
I wonder if running w chromium browser would produce different results.
easiest way to test
download the run-start.sh script from here
https://github.com/sdetweil/MagicMirror_scripts
into the MagicMirror folder
edit the package.json and change the start command to"start":"./run-start.sh",
edit config.js
and setserverOnly:"local",
this will start mm in server mode, and use chromium to display instead of electron
-
Would that be any different than running it in server mode and accessing it from a browser on my computer across the network? That would be simpler to set up and wouldn’t add more running software onto the Pi…
-
@ember1205 same, no new software on the pi. mm install installs everything.
can run as
full ---- how it is now
server only
server only w different browser ( already installed)
or
client only -
Understood that there isn’t new software installed, but this would mean no additional software actively running on the Pi (Electron would be stopped, and all browser software would be running from a different machine).
-
@ember1205 right. that doesn’t mean u fixed the out of memory problem. it’s possible.
I was working on one change at a time.
u can install the run-start.sh and change config.js to serverOnly: true, then launch browser from your pc