fastfetch icon indicating copy to clipboard operation
fastfetch copied to clipboard

[FEAT] Subtract ZFS ARC from memory usage

Open leo60228 opened this issue 2 months ago • 5 comments

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.

leo60228 avatar Oct 03 '25 16:10 leo60228