简体   繁体   中英

Web browser memory on Raspberry Pi

I'm using a Raspberry Pi to display information collected from some automated equipment in an industrial environment. The data is collected and stored in a database on an industrial PC; I've got the Pi hooked up to it via a wired network, and I'm using PHP to pull data out of the database and display it.

The issue I'm running in to is with memory. I'm running just a test right now, pulling a table with one record and three columns and displaying it on the web page, and using header("Refresh: 2; URL=$_SERVER['REQUEST_URI']"); to keep the information updated. After getting the Dead Jim page in Chromium a few times, I started keeping track of memory with vmstat to see how quickly it's getting used up. Chromium eats about 5.4 MB a minute, and Midori 4.8 MB per minute.

This is a process that's supposed to run 24/7, rebooting maybe once a week when the industrial equipment goes down for maintenance. What can I do to help out with memory usage? Is there some sort of browser setting to prevent caching anything that might help? Is there a better browser out there that I should be using? I've seen these sorts of issues all over the place in messageboards across the web, so I don't think it's my php code that's doing it, though I'll put it up if anybody thinks that could be the problem.

It looks like you make the browser refresh the page after fixed time delay no matter if your raspberry ( web server) was able to create a new page and complete the process or not. I also had situations where my browser showed up a blank page by doing similar things. My solution for that was simply to synchronize both. Which means

  1. The browser requests data from your web server
  2. the server creates data and sends it to the browser
  3. The browser waiting for the data updates it's display and delays some time or creates a new request immediately

As far as I know this is a typical scenario and use-case for AJAX.

I was running into a similar issue with my raspberry pi using chromium. I am holding a webpage open and having it refresh at various intervals, only the browser was not updating my metrics. After booting with this flag disable the problem was resolved. Consider giving this a try.

In kiosk mode, in auto start I flipped this flag: --disable-gpu-program-cache

You can find more documentation here: http://www.chromium.org/developers/design-documents

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM