SWAP seems a "bit" exessive on clean install

I used this script to install the ultra light version (only cli).

Have ONLY installed lm_sensors htop wget & cifs-utils

I just noticed the swap in the block devices.

mmcblk0     179:0    0   7.4G  0 disk 
├─mmcblk0p1 179:1    0 457.8M  0 part /boot
└─mmcblk0p2 179:2    0   6.9G  0 part /
zram0       253:0    0  11.4G  0 disk [SWAP]

I do have the 8gb version but, 11.4G? And my sd-card is 8G… xD

/dev/zram0 partition 11.4G   0B  100

df -h looks pretty normal though.

Filesystem                   Size  Used Avail Use% Mounted on
dev                          3.6G     0  3.6G   0% /dev
run                          3.9G  488K  3.9G   1% /run
/dev/mmcblk0p2               6.8G  1.7G  4.8G  26% /
tmpfs                        3.9G     0  3.9G   0% /dev/shm
tmpfs                        3.9G     0  3.9G   0% /tmp
/dev/mmcblk0p1               458M   55M  403M  12% /boot
tmpfs                        782M     0  782M   0% /run/user/1000
//  2.8T  1.4T  1.5T  49% /mnt/backup

And nothing strange in my fstab:

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
PARTUUID=867145fb-01  /boot   vfat    defaults,noexec,nodev,showexec     0   0
PARTUUID=867145fb-02   /   ext4     defaults    0   1


  Kernel: 6.1.34-1-MANJARO-ARM-RPI arch: aarch64 bits: 64 compiler: gcc
    v: 12.1.0 parameters: coherent_pool=1M 8250.nr_uarts=0
    snd_bcm2835.enable_headphones=0 snd_bcm2835.enable_headphones=1
    snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_hdmi=0
    smsc95xx.macaddr=E4:5F:01:BD:BD:BD vc_mem.mem_base=0x3ec00000
    vc_mem.mem_size=0x40000000 root=PARTUUID=867145fb-02 rw rootwait
    console=ttyS0,115200 console=tty3 selinux=0 quiet splash
    plymouth.ignore-serial-consoles smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0
    kgdboc=ttyS0,115200 usbhid.mousepoll=8 audit=0
  Console: pty pts/0 Distro: Manjaro ARM base: Arch Linux
  Type: ARM System: Raspberry Pi 4 Model B Rev 1.5 details: BCM2835 rev: d03115
    serial: <filter>
  Message: No system battery data found. Is one present?
  System RAM: available: 7.63 GiB used: 270.7 MiB (3.5%) gpu: 76 MiB
  RAM Report: missing: Required tool dmidecode not installed. Check
  Info: model: N/A variant: cortex-a72 bits: 64 type: MCP arch: ARMv8 family: 8
    model-id: 0 stepping: 3
  Topology: cpus: 1x cores: 4 smt: N/A cache: L1: 320 KiB
    desc: d-4x32 KiB; i-4x48 KiB L2: 1024 KiB desc: 1x1024 KiB
  Speed (MHz): avg: 600 min/max: 600/1500 scaling: driver: cpufreq-dt
    governor: schedutil cores: 1: 600 2: 600 3: 600 4: 600 bogomips: 432
  Features: asimd cpuid crc32 evtstrm fp
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed status: Not affected
  Type: spec_store_bypass status: Vulnerable
  Type: spectre_v1 mitigation: __user pointer sanitization
  Type: spectre_v2 status: Vulnerable
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
  Device-1: bcm2711-hdmi0 driver: vc4_hdmi v: N/A bus-ID: N/A
    chip-ID: brcm:fef00700 class-ID: hdmi
  Device-2: bcm2711-hdmi1 driver: vc4_hdmi v: N/A bus-ID: N/A
    chip-ID: brcm:fef05700 class-ID: hdmi
  Device-3: bcm2711-vc5 driver: vc4_drm v: N/A bus-ID: N/A chip-ID: brcm:gpu
    class-ID: gpu
  Display: server: No display server data found. Headless machine?
    tty: 212x26
  API: N/A Message: No display API data available in console. Headless
  Device-1: bcm2711-hdmi0 driver: vc4_hdmi bus-ID: N/A chip-ID: brcm:fef00700
    class-ID: hdmi
  Device-2: bcm2711-hdmi1 driver: vc4_hdmi bus-ID: N/A chip-ID: brcm:fef05700
    class-ID: hdmi
  API: ALSA v: k6.1.34-1-MANJARO-ARM-RPI status: kernel-api tools: N/A
  Device-1: bcm2835-mmc driver: mmc_bcm2835 v: N/A port: N/A bus-ID: N/A
    chip-ID: brcm:fe300000 class-ID: mmcnr
  IF: wlan0 state: down mac: <filter>
  Device-2: bcm2711-genet-v5 driver: bcmgenet v: N/A port: N/A bus-ID: N/A
    chip-ID: brcm:fd580000 class-ID: ethernet
  IF: end0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> scope: link
  WAN IP: <filter>
  Device-1: pl011 driver: uart_pl011 bus-ID: N/A chip-ID: arm:fe201000
    class-ID: serial
  Report: rfkill ID: hci0 rfk-id: 0 state: down bt-service: not found
    rfk-block: hardware: no software: no address: see --recommends
  Device-2: pl011 driver: N/A bus-ID: N/A chip-ID: arm:serial0
    class-ID: serial
  Report: This feature requires one of these tools: hciconfig/bt-adapter
  Message: No logical block device data found.
  Message: No RAID data found.
  Local Storage: total: 7.37 GiB used: 1.66 GiB (22.5%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/mmcblk0 maj-min: 179:0 vendor: Silicon Power model: SPCC
    size: 7.37 GiB block-size: physical: 512 B logical: 512 B tech: SSD
    serial: <filter> scheme: MBR
  Message: No optical or floppy data found.
  ID-1: / raw-size: 6.89 GiB size: 6.7 GiB (97.30%) used: 1.61 GiB (23.9%)
    fs: ext4 dev: /dev/mmcblk0p2 maj-min: 179:2 label: ROOT_MNJRO
    uuid: 07250076-91dc-4969-bbf7-34b29e0d00c2
  ID-2: /boot raw-size: 457.8 MiB size: 457.5 MiB (99.94%)
    used: 54.7 MiB (12.0%) fs: vfat dev: /dev/mmcblk0p1 maj-min: 179:1
    label: BOOT_MNJRO uuid: 91BC-5471
  ID-3: /mnt/backup raw-size: N/A size: 2.73 TiB used: 1.32 TiB (48.4%)
    fs: cifs dev: /dev/raspberry-pi
  Kernel: swappiness: 60 (default) cache-pressure: 80 (default 100)
  ID-1: swap-1 type: zram size: 11.44 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
  Message: No unmounted partitions found.
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 1 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-2: 1-1:2 info: VIA Labs Hub ports: 4 rev: 2.1
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 power: 100mA
    chip-ID: 2109:3431 class-ID: 0900
  Hub-3: 2-0:1 info: super-speed hub ports: 4 rev: 3.0
    speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 1d6b:0003
    class-ID: 0900
  System Temperatures: cpu: 40.4 C mobo: N/A
  Fan Speeds (RPM): N/A
  Processes: 150 Uptime: 27m Init: systemd v: 253 default: graphical
  tool: systemctl Compilers: N/A Packages: pm: pacman pkgs: 218 libs: 55
  Shell: Bash v: 5.1.16 running-in: pty pts/0 (SSH) inxi: 3.3.27


Its set at 1.5x your RAM …
I would guess its to ensure hibernation … but then why not 1x and/or make use of something like /etc/tmpfiles.d/hibernation_image_size.conf

The swap is not using your disk. It is stored in a compressed state in the RAM. The total space allotted is determined at boot according to how much RAM is on board your device. The main reason for the swap was to accommodate devices with low ram to keep them from freezing up using programs that used a lot of resources. A swap to the disk was pain takingly slow. The swap probably is not really needed on the 8G RAM boards but about 3 years ago we decided to just include it on all devices since it really did not seem to hurt anything during normal use. Back when we were compiling firefox using distcc it was a lifesaver because the system would lock up with out the swap.

1 Like

So I can just swapoff -a or should I just leave it and never look at it again?

sudo systemctl stop zswap-arm
sudo systemctl disable zswap-arm

If you ever decide you might need it just enable/start the service again.

1 Like

Uhm. It sounds like you are talking about zram.
zswap does use compress-in-ram … but then unloads to disk.
zswap must work in tandem with allocated swap space (on disk).
zram however does not require any swap device.

Of course I dont contest which one is in use or that you implemented … it just seems there may be confusion about how these different features work.

1 Like

You are right. The file name is confusing.

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