Wrong calculation of ZRAM size

Dear all,

I am on the OpenWrt snapshot (OpenWrt SNAPSHOT, r0-a56cbe3). I have compiled the OpenWRT image and have selected the option to mount tmpfs on ZRAM im Procd.

However, there seems to be a mistake in how the size for ZRAM0 and therefore the tmpfs is calculated. I have 4GB RAM on the router but the size of ZRAM0 (and tmpfs) is fixed at 16MB (instead of 2GB). This makes the system unusuable, since tmpfs quickly fills up.

[    3.339773] zram: Added device: zram0
[    3.453891] zram0: detected capacity change from 0 to 16777216

I have tested with different RAM sizes (via virtual machine) and I always end up with the same size.

ZRAM1 that is used for the swap space always uses ALL available RAM:

[   10.125179] zram: Added device: zram1
[   10.206334] zram1: detected capacity change from 0 to 4294967296

The settings in LUCI...SYSTEM...ZRAM settings do not seem to have any impact on either ZRAM0 or ZRAM1.

Where are the settings for ZRAM0 and ZRAM1 located so that I can change them? Probably it would be best to set ZRAM0 and ZRAM1 both at max 50% of available RAM?

Thank you,
Alex

1 Like