Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Most android roms have only one zram device [zram0] but linux distros use many zram like zram0, zram1 ....
Why is it like that? Does using many zram consumes more power or adds complexity? what's the exact reason?
It's a debatable topic whether or not multiple ZRAM devices add any benefit. E.g. see this: askubuntu.com/questions/1171950. Apart from that, you can create as many ZRAM devices as you want on Android too. Pass zram.num_devices=<NUM> parameter in kernel commandline. After boot do: echo -n <SIZE> >/sys/block/zram[N]/disksize; mkswap /dev/block/zram[N]; swapon /dev/block/zram[N]. That's all.
zram.num_devices=<NUM>
parameter in kernel commandline. After boot do:echo -n <SIZE> >/sys/block/zram[N]/disksize; mkswap /dev/block/zram[N]; swapon /dev/block/zram[N]
. That's all.