Resource Monitor Type ZRAM

In addition to rm() memory types:
mfree
mused
mtot
Is it possible to retrieve ZRAM values? Maybe zfree, zused, ztot?

Example from DevCheck:

By ZRAM do you mean the swap values when I run “free” on bash?

total        used        free      shared  buff/cache   available
Mem:        11506124     5558892      453580      192756     5493652     5521600
Swap:        4194300     1821844     2372456

You could grep and parse them like this:

free | grep "Swap:" | (read MEM; IFS=' '; read -ra CATEGORY<<<"$MEM";echo ${CATEGORY[1]})
# Will return 4194300, change the category index to get the other values.

And you could probably run that through sh().

1 Like

Many Thanks @doog ,

Yes likely swap rather than ZRAM.
Running extended memory on POCO X4 GT with HyperOS.
When extended memory enabled it’s allocating and using system file storage; so not true ZRAM and merely swap disguised as RAM.
Has me rethinking if this is desirable to enable or not.

Gratefully appreciate your suggestion to grep and parse “free” along with included syntax.
Had similar thoughts getting swap values through sh() but got hung up on the syntax.
Much obliged my friend.

Will give your suggestion a go and report back findings.
Many Thanks once again for your time and effort.

1 Like