Skip to content
Cardiac edited this page Mar 26, 2024 · 9 revisions

Enabling Zram :

sudo pacman -S zram-generator
sudo pacman -S zram-generator
echo -e '[zram0]\nzram-size = ram / 4\ncompression-algorithm = zstd\nswap-priority = 100\nfs-type = swap' | sudo tee -a /etc/systemd/zram-generator.conf

In the given script, zram-generator is being installed and configured for a system that prioritizes gaming. The configuration in /etc/systemd/zram-generator.conf is tailored to optimize performance for gaming applications. Here's a breakdown of the configuration:

[zram0]
zram-size = ram / 4
compression-algorithm = zstd
swap-priority = 100
fs-type = swap

This setup indicates that:

  • A Zram device (zram0) is created.
  • The size of the Zram swap area is set to a quarter of the total RAM (ram / 4). Keeping the Zram partition small is intentional, as compression introduces overhead. For gaming-oriented systems, it's crucial to minimize this overhead to maintain high performance. By limiting the amount of RAM used for Zram, more physical RAM is available for gaming applications, which can be particularly beneficial for systems with limited memory.
  • The compression-algorithm is set to zstd (Zstandard), known for its balance between compression ratio and speed. Zstandard offers efficient compression, helping to save RAM space without significantly impacting performance.
  • swap-priority is set to 100, indicating the priority of this swap area relative to others. A higher priority helps ensure that this swap space is used preferentially.
Clone this wiki locally