Skip to content

[FEAT] Subtract ZFS ARC from memory usage #1995

@leo60228

Description

@leo60228

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions