Skip to content

ZFS ARC memory on Linux is not subtracted from used memory when htop is running as root #1405

@GermanCoding

Description

@GermanCoding

Hello,

I just noticed the following weird behaviour. If I run htop as a non-root user (with no capabilites) htop 3.3.0 properly treats ARC memory as cache memory:

non-root

However, when I run htop as root the memory bar looks like this:

as-root

The memory in question is ZFS ARC memory:

with-arc-bar

The top two screenshots are made with default htop settings, i.e. no customization applied.

Both the normal and the root user can access /proc/spl/kstat/zfs/arcstats. Note that it's the unprivileged user that works properly. Both users can show the ARC stats bar in htop normally, it's just that the root user doesn't properly adjust the memory bar.

OS: Debian Bookworm, Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
htop: Tested both debian package and 3.3.0 built from source
ZFS: zfs-2.2.2-4~bpo12+1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions