Help need for increasing the zram size

Hello Garuda users,

System:
Kernel: 6.6.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc available: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=a526a2d4-154b-4828-bcc8-6b0798ec273d rw rootflags=subvol=@
quiet loglevel=3 ibt=off
Desktop: KDE Plasma v: 5.27.9 tk: Qt v: 5.15.11 wm: kwin_wayland vt: 1
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: HP product: HP Pavilion Gaming Laptop 15-ec1xxx v: N/A
serial: <superuser required> Chassis: type: 10 serial: <superuser required>
Mobo: HP model: 87B2 v: 31.25 serial: <superuser required> UEFI: AMI
v: F.32 date: 10/25/2023
Battery:
ID-1: BAT0 charge: 37.7 Wh (92.6%) condition: 40.7/40.7 Wh (100.0%)
power: 10.4 W volts: 12.1 min: 11.6 model: Hewlett-Packard Primary
type: Li-ion serial: N/A status: discharging cycles: 365
CPU:
Info: model: AMD Ryzen 5 4600H with Radeon Graphics bits: 64 type: MT MCP
arch: Zen 2 gen: 3 level: v3 note: check built: 2020-22
process: TSMC n7 (7nm) family: 0x17 (23) model-id: 0x60 (96) stepping: 1
microcode: 0x8600109
Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB L3: 8 MiB
desc: 2x4 MiB
Speed (MHz): avg: 2732 high: 3000 min/max: 1400/3000 boost: enabled
scaling: driver: acpi-cpufreq governor: performance cores: 1: 3000 2: 3000
3: 3000 4: 3000 5: 3000 6: 3000 7: 1397 8: 1397 9: 3000 10: 3000 11: 3000
12: 3000 bogomips: 71863
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: NVIDIA TU117M [GeForce GTX 1650 Ti Mobile] vendor: Hewlett-Packard
driver: nvidia v: 545.29.06 alternate: nouveau,nvidia_drm non-free: 545.xx+
status: current (as of 2023-10; EOL~2026-12-xx) arch: Turing code: TUxxx
process: TSMC 12nm FF built: 2018-2022 pcie: gen: 1 speed: 2.5 GT/s
lanes: 8 link-max: gen: 3 speed: 8 GT/s lanes: 16 ports: active: none
empty: HDMI-A-1 bus-ID: 01:00.0 chip-ID: 10de:1f95 class-ID: 0300
Device-2: AMD Renoir vendor: Hewlett-Packard driver: amdgpu v: kernel
arch: GCN-5 code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3
speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s ports:
active: eDP-1 empty: none bus-ID: 05:00.0 chip-ID: 1002:1636
class-ID: 0300 temp: 46.0 C
Device-3: Quanta HP TrueVision HD Camera driver: uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-3:2 chip-ID: 0408:5365
class-ID: 0e02
Display: wayland server: X.org v: 1.21.1.9 with: Xwayland v: 23.2.2
compositor: kwin_wayland driver: X: loaded: amdgpu,nvidia
unloaded: modesetting,nouveau alternate: fbdev,nv,vesa dri: radeonsi
gpu: nvidia,amdgpu display-ID: 0
Monitor-1: eDP-1 res: 1536x864 size: N/A modes: N/A
API: EGL v: 1.5 hw: drv: nvidia drv: amd radeonsi platforms: device: 0
drv: nvidia device: 1 drv: radeonsi device: 3 drv: swrast gbm: drv: nvidia
surfaceless: drv: nvidia wayland: drv: radeonsi x11: drv: radeonsi
inactive: device-2
API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: amd mesa v: 23.2.1-arch1.2
glx-v: 1.4 direct-render: yes renderer: AMD Radeon Graphics (renoir LLVM
16.0.6 DRM 3.54 6.6.3-zen1-1-zen) device-ID: 1002:1636 memory: 500 MiB
unified: no display-ID: :1.0
API: Vulkan v: 1.3.269 layers: 4 device: 0 type: integrated-gpu name: AMD
Radeon Graphics (RADV RENOIR) driver: mesa radv v: 23.2.1-arch1.2
device-ID: 1002:1636 surfaces: xcb,xlib,wayland device: 1
type: discrete-gpu name: NVIDIA GeForce GTX 1650 Ti driver: nvidia
v: 545.29.06 device-ID: 10de:1f95 surfaces: xcb,xlib,wayland device: 2
type: cpu name: llvmpipe (LLVM 16.0.6 256 bits) driver: mesa llvmpipe
v: 23.2.1-arch1.2 (LLVM 16.0.6) device-ID: 10005:0000
surfaces: xcb,xlib,wayland
Audio:
Device-1: NVIDIA vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
pcie: gen: 3 speed: 8 GT/s lanes: 8 link-max: lanes: 16 bus-ID: 01:00.1
chip-ID: 10de:10fa class-ID: 0403
Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard
driver: N/A alternate: snd_pci_acp3x, snd_rn_pci_acp3x, snd_pci_acp5x,
snd_pci_acp6x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh pcie:
gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s
bus-ID: 05:00.5 chip-ID: 1022:15e2 class-ID: 0480
Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard
driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.6 chip-ID: 1022:15e3
class-ID: 0403
API: ALSA v: k6.6.3-zen1-1-zen status: kernel-api tools: N/A
Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: Hewlett-Packard driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
lanes: 1 port: e000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: eno1 state: down mac: <filter>
Device-2: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter
vendor: Hewlett-Packard driver: rtw_8822ce v: N/A modules: rtw88_8822ce
pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 03:00.0
chip-ID: 10ec:c822 class-ID: 0280
IF: wlo1 state: up mac: <filter>
Bluetooth:
Device-1: Realtek Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-4:2 chip-ID: 0bda:b00c
class-ID: e001 serial: <filter>
Report: btmgmt ID: hci0 rfk-id: 1 state: down bt-service: enabled,running
rfk-block: hardware: no software: no address: <filter> bt-v: 5.1 lmp-v: 10
status: discoverable: no pairing: no
Drives:
Local Storage: total: 1.14 TiB used: 8.05 GiB (0.7%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: PC SN730
SDBPNTY-256G-1006 size: 238.47 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: HPS2 temp: 43.9 C scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
model: WD10SPSX-60A6WT0 size: 931.51 GiB block-size: physical: 4096 B
logical: 512 B speed: 6.0 Gb/s tech: HDD rpm: 7200 serial: <filter>
fw-rev: 1A01 scheme: GPT
Partition:
ID-1: / raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
used: 8.05 GiB (3.4%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
used: 8.05 GiB (3.4%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
used: 8.05 GiB (3.4%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 238.17 GiB size: 238.17 GiB (100.00%)
used: 8.05 GiB (3.4%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 14.99 GiB used: 0 KiB (0.0%) priority: 100
comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 12 dev: /dev/zram0
Sensors:
System Temperatures: cpu: 47.9 C mobo: N/A gpu: amdgpu temp: 47.0 C
Fan Speeds (rpm): fan-1: 0 fan-2: 0
Info:
Processes: 372 Uptime: 5m wakeups: 0 Memory: total: 16 GiB note: est.
available: 14.99 GiB used: 3.26 GiB (21.7%) Init: systemd v: 254
default: graphical tool: systemctl Compilers: gcc: 13.2.1 Packages:
pm: pacman pkgs: 1284 libs: 364 tools: octopi,paru Shell: fish v: 3.6.1
running-in: konsole inxi: 3.3.31
Garuda (2.6.19-2):
System install date:     2023-11-29
Last full system update: 2023-11-29 ↻
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut nvidia-dkms
Windows dual boot:       Probably (Run as root to verify)
Failed units:

So I have followed this guide to increase my zram size What can I do to get rid of swap and use zram only? | I made a mistake during the install - #8 by Cannabis

Here’s my config file,

zram-configuration.conf:
[zram0]
host-memory-limit = none
zram-size = ram * 5
compression-algorithm = zstd
zram-fraction = 1

Zram is set up by default in Garuda Linux. There is no need to take any additional action.

See here, it is showing up as a swap device:

In the thread you linked, the person had set up a second swap device (in addition to the zram) which they wanted to remove. There were some complications with the approach that was chosen and zram needed to be reconfigured.

6 Likes

Yeah I agree that the zram is enabled by default in Garuda Linux but I just want to increase my zram size(by default it’s 15 gb). That’s why I have added zram-size = ram * 5 to my configuration file (/usr/lib/systemd/zram-generator.conf)

You have a total of 16 GB physical RAM installed,

How exactly are your plans to exceed that supposed to work? And why? It’s easy to setup, but not the way you are going about it. See the Arch Wiki.

3 Likes

First I have installed Garuda Linux on my HDD and edited zram configuration and it worked surprisingly. But now I have installed Garuda Linux on SSD and I’m using the same configuration file and it’s not working.
I’m an AOSP developer and 16gb ram is nothing for me to work things out that’s why I’m trying to increase the zram size.

Your use case is your use case. Read the wiki. zram - ArchWiki (archlinux.org) Section 1.1 looks interesting.

2 Likes

I think you are not understanding what zram is. What Bro is trying to explain is that zram, unlike a swap partition or a swap file, uses RAM–not the hard drive. If you want more zram you need to install more RAM.

If you need additional swap beyond what zram is providing you should set up another swap device using your hard drive.

5 Likes

I read somewhere that using a regular swap along zram is not ideal, if I recall correctly it would end up swapping to disk the recent pages and keeping least accessed ones in ram.
I have not experimented with it, but zram should also allow to set up a “backing device” to spill over to disk more efficiently.
Anyone tried that? I’m interested too.
OP may also be interested in trying other compression algorithms, maybe that can squeeze available RAM a little more (at the expense of higher CPU usage).

1 Like

No, you really can make multipliers, if I read the wiki right. It does have to be setup a bit different from OPs example. But I’m in the partial dark as to which/what ZRAM, ZSWAP, etc. & settings Garuda uses. IIRC, nico has made a change or so since Garuda’s inception.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.