Escolar Documentos
Profissional Documentos
Cultura Documentos
www.techrapid.co.uk /linux/arch-linux/create-zram-memory-compression-on-arch-linux
zRam is a virtual memory compression using block devices named /dev/zram using a fast compression algorithm
that compress the least recently used (LRU) or inactive space in the memory allows the GNU/Linux kernel to free
up more memory with less performance hit.
zRam is greatly increasing the available amount of memory without swap disks/partition. It is recommended
for user to use zRam instead of not using swap or swap on slow disks.
Enable the zRam block devices for swapping with high priority:
Shell
1
1
2
3
4
5
6
7
8
9
10
11
[Unit]
Description=zRam block devices swapping
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c "modprobe zram && echo lz4 > /sys/block/zram0/comp_algorithm | echo 2G >
/sys/block/zram0/disksize && mkswap --label zram0 /dev/zram0 && swapon --priority 100 /dev/zram0"
ExecStop=/usr/bin/bash -c "swapoff /dev/zram0 && rmmod zram"
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
See also
1. Zram or zswap section (Maximizing Performance) ArchWiki
2. zram: Compressed RAM based block devices Linux Kernel Documentation
3. Image by TobiasD / CC0 Public Domain
Related Articles
Automatically Update Arch Linux with Systemd
Install AUR Packages with Yaourt on Arch Linux
Install KDE Plasma 5 on Arch Linux
Improve Fonts Rendering Quality on Arch Linux
Updating Dynamic DNS (DDNS) With Wget on Linux