I was struggling with a crash. I logged the mem usage with SAR
sudo apt-get install sysstat
Then I output to a log every few minutes so if it did crash I could go back through.
sar -r 1 > somefile.log
The exact issue I was having was with an iFrame Module iFrame-Ping:
I run a YouTube Playlist - that will eventually bring up the module by voice command.
//iFrame Module - Contains Fox News Playlist on YouTube - Autoplay - Modest Branding (no logo) - iv Load Policy = 3 (no annotations) - Controls = 0 (no controls shown)
{
module: 'MMM-iFrame-Ping',
position: 'top_right',
config: {
url: "https://www.youtube.com/embed/?listType=playlist&list=PLlTLHnxSVuIyeEZPBIQF_krewJkY2JSwi&index=-1&autoplay=1&modestbranding=1&iv_load_policy=3&controls=0",
autoRefresh: true,
updateInterval: 120,
width: "560px",
height: "340px",
scrolling: "no"
}
},
The iFrame video was crashing the PI so I decided to increase the swapfile size. Before I increased the size my PI would make it about 2-4 hours. Now I can literally run it for days without an issue.
sudo nano /etc/dphys-swapfile
Change CONF_SWAPSIZE=100
CONF_SWAPSIZE=1024
Stop/Start the Service
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
You can log with SAR or just do
free -m
Some people set the swapfile to 0, but others warn against it. If you want to
CONF_SWAPSIZE=0