0

I'm running a raspberry with a small monitor in kiosk mode, which means: it's running a full-screen chromium tab all around the clock. The problem is that I have noticed that there are many websites out there where the programmers did not notice that the website will cause memory leaks when you run it for hours and hours. And so does my chromium after about one day.

Since I don't want to fix the problems of other people's website, the question is the following:

Can I solve the issue with a construction of two daemons where one daemon tries to keep chromium alive, where the other daemon kills chromium regularly?

Or is there a more elegant solution to this?

(So far I only have the chromium launch command for that website in the start-up script for my desktop environment.)

  • For the interested: this is how I launch one of the sites in question in my ~/.config/lxsession/LXDE-pi/autostart @chromium-browser --noerrdialogs --kiosk bitcointicker.co/kraken --incognito – Ulf S. Jun 15 '18 at 10:35
  • Have you considered rebooting the Pi regularly and automatically to cure all memory woes including fragmentation? – OyaMist Jun 15 '18 at 13:46
  • 1
    Well, yes, I have considered it. I would actually either SSH into it and reboot it or I would unplug the power cord for a moment when I'm in the kitchen.. But that's far from an optimal solution. Automating that with a service would not make it better. Essentially I don't want to reboot the raspberry since I'm also running node-red on it, which is supposed to pull data from the net and put it in my databases. And it disturbs the state machines which would monitor my network and send me an alert when a machine went offline.. – Ulf S. Jun 15 '18 at 14:16
  • Hmm. Chromium is designed for speed and is a known memory hog. I would consider other browsers with gentler memory usage. – OyaMist Jun 15 '18 at 14:19
  • Alternatively, separate client from server. Chromium need not run on the high-uptime node server – OyaMist Jun 15 '18 at 14:22
0

The traditional solution for memory leaks and fragmentation is to reboot the server. This is not elegant but it is effective and commonly done in datacenters as required.

A more targeted solution would be to examine the browser itself. Although nimble and powerful, Chromium is a bit of a memory hog. Finding a good browser for the Raspberry Pi can be challenging and requires careful analysis of application tradeoffs (e.g., media types, Javascript support, etc.).

Lastly, if server uptime is a concern for data-gathering and state management, isolating the Chromium browser on its own periodically rebootable Raspberry Pi offers many advantages. The tradeoffs will be additional wiring for power and space considerations.

  • 1
    Thanks. I guess I will go with a "reboot at night" solution then. – Ulf S. Jun 15 '18 at 15:47
  • Glad we worked out an answer. Click to accept this answer if you feel others may benefit from this interaction. – OyaMist Jun 15 '18 at 17:13
0

Create a cron job or a script running at regular intervals which restarts the browser:

killall chromium-browser
nohup chromium-browser --noerrdialogs --kiosk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.