py3status icon indicating copy to clipboard operation
py3status copied to clipboard

ignore ZFS ARC cache in memory usage

Open anarcat opened this issue 2 years ago • 0 comments

Workstations with a ZFS filesystem will report an abnormal memory usage due to the ZFS ARC cache. For example, on my workstation, the ARC cache takes up 6GB out of the 16GB core memory. Total memory usage, as reported by py3status, is close to 87%, quite alarming, but when we know about the ZFS cache, this is no big deal.

Note that tools like top(1) also get it wrong, but htop(1) and btop(1) don't. I actually took this idea from btop.

I didn't make this customizable because there's one of two things here, either:

  1. the user doesn't have a ZFS setup and this will silently not change anything, or;

  2. the use has a ZFS setup and they will almost certainly want to count that out of their memory usage

btop(1) actually makes this configurable, but I think that's superfluous: who would want to count that in anyways?

Obviously, this is kind of a flaw in the (Linux?) implementation of ZFS: ZFS should use the normal caching systems of the operating system. But considering how different that cache is, that might be practical (the Linux memory cache is a LRU cache, and ZFS is an ARC cache).

I suspect this may also work on other ZFS implementations, but I haven't tested those.

anarcat avatar Jun 22 '22 19:06 anarcat