Remix.run Logo
jkrejcha an hour ago

> The “cached” memory includes tmpfs and ramfs for seemingly no reason.

If you're curious why that is by the way, it's because that's actually how these are implemented (tmpfs/ramfs is just a mount to a filesystem where the files never get marked clean[1])

[1]: https://www.kernel.org/doc/Documentation/filesystems/ramfs-r...

drdexebtjl an hour ago | parent [-]

That’s clever. Makes for terrible UX, though.

AFAIK the only way for you to figure out how much of your disks is actually cached involves enumerating all tmpfs and ramfs mounts, summing their sizes, and subtracting the sum from the cache size reported by the kernel.

jkrejcha 41 minutes ago | parent [-]

Ostensibly you could subtract "Shmem"[1] in /proc/meminfo from the cached value... maybe?

Do agree it's not the best UX and utilities should probably do a better job at showing that

[1]: https://man7.org/linux/man-pages/man5/proc_meminfo.5.html