fastfetch
fastfetch copied to clipboard
[FEAT] Subtract ZFS ARC from memory usage
Description
The displayed memory in use should exclude ZFS's ARC, similarly to tools like htop.
Motivation
Implementing this in a shell is non-trivial, and it's a logical extension of existing functionality.
Additional context
Due to Linux kernel limitations, ZFS's in-memory caches aren't included in MemAvailable despite being logically equivalent. fastfetch should subtract the size of ZFS's cache, similarly to other tools like htop. There's already ZFS-specific code in fastfetch for filesystem handling.
This can be implemented by reading /proc/spl/kstat/zfs/arcstats in addition to /proc/meminfo if it's present, and adding size - c_min to MemAvailable.