[mythtv-users] rPi3 ram consumption causing playback freezing

Simon Hobson linux at thehobsons.co.uk
Sat Jul 15 18:09:41 UTC 2017


Tim Draper <veehexx at zoho.com> wrote:

> 'htop' is showing ~85% general usage, ~1% buffer, and the remaining ~14% as buffer cache.... which brings total ram consumption to completely maxed out @ 100%.

Ah, no it isn't "maxed out" ! You have 14% "available".
The idea of the buffer cache is that any memory not otherwise used will be used to hold pages waiting to be written to disk (should be very little in this application, shown as "Dirty" in /proc/mem) and pages recently read from disk. If anything requests more memory, then pages are dropped from the read cache to free up pages to satisfy the request - and this should be a very low latency operation.

Memory that isn't in use or used for buffer cache is wasted memory.

> clearing the pagecache sorted the problem out with the following command without a reboot being required:
> sync; echo 1 > /proc/sys/vm/drop_caches

That suggests that the full buffers aren't necessarily the problem, more likely a symptom of the real problem.
FWIW, on my Mac (still on OS X 10.8) I have a similar problem. IN THEORY, cache should be dropped when the memory is wanted for something else. In practice, I find memory management is going wrong somewhere and the system will swap stuff to disk to make space, in preference to dropping cache space - I think it has faulty logic in determining when "inactive"* memory should be re-assigned. The result is exactly as you describe - the system gets slow and laggy due to the swapping until I drop the caches.

It would be interesting to try and see what is being used for what - but TBH that's beyond my technical skills here.

* On OS X, "inactive" is a class of memory that's been recently used, but is currently free. I believe it includes both read-cache and memory previously allocated to an application.



More information about the mythtv-users mailing list