The compressed RAM actually in use by zram (from the MEM-USED column of zramctl --output-all) should in practice be visible in the data from the "free" command. I assume that it is accounted for in the "used" column (I can see it is not subtracted from the "total" column!). Is this correct?
(However, it is not "used" in the sense of "eligible for swap", like resident program memory, so perhaps a separate column would be more appropriate . . .)
Example:
$ free -hw
total used free shared buffers cache available
Mem: 2.8Gi 2.4Gi 208Mi 65Mi 7.6Mi 459Mi 456Mi
Swap: 3.0Gi 1.2Gi 1.8Gi
$ zramctl --output-all
NAME DISKSIZE DATA COMPR ALGORITHM STREAMS ZERO-PAGES TOTAL MEM-LIMIT MEM-USED MIGRATED MOUNTPOINT
/dev/zram0 3G 1.2G 262.6M lz4 2 15281 270.1M 0B 321.3M 18.6K [SWAP]
Asked by m4r35n357
(111 rep)
May 7, 2025, 02:14 PM
Last activity: May 7, 2025, 02:25 PM
Last activity: May 7, 2025, 02:25 PM