安装软件包
apt install systemd-zram-generator
配置zram-generator
创建zram-generator配置文件
nano /etc/systemd/zram-generator.conf
填入配置
[zram0] zram-size = min(ram / 2, 4096) compression-algorithm = zstd
zram大小为内存的二分之一,最大4096MiB
启动zram
sudo systemctl daemon-reload sudo systemctl start systemd-zram-setup@zram0.service
文章评论