From 92c83735e1f9e0c5f39b2c5974072eadd825098d Mon Sep 17 00:00:00 2001 From: donoban Date: Sat, 10 Jan 2026 12:09:37 +0100 Subject: [PATCH] Change default size0 to 1/2 of total memory --- openrc/conf.d/zram-init | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openrc/conf.d/zram-init b/openrc/conf.d/zram-init index 4373d1d..0435311 100644 --- a/openrc/conf.d/zram-init +++ b/openrc/conf.d/zram-init @@ -56,11 +56,11 @@ num_devices=2 # # Only variables with numbers 0 ... num_devices-1 are used by the script. -# swap - 500M (or a fourth of available memory if uncommenting) +# swap - defaults to 1/2 of total memory type0=swap flag0= # The default "16383" is fine for us -size0=512 -#size0=`LC_ALL=C free -m | awk '/^Mem:/{print int($2/4)}'` +size0=$(awk '/MemTotal/{print int($2/2/1024)}' /proc/meminfo) +#size0=512 # fixed size in MB mlim0= # no hard memory limit back0= # no backup device icmp0= # no incompressible page writing to backup device