Put these on the terminal
sudo modprobe zram
and then
sudo sh -c "echo 'lz4' > /sys/block/zram0/comp_algorithm"
You can change it what you want
2G or 4G
sudo sh -c "echo '2G' > /sys/block/zram0/disksize"
sudo mkswap --label zram0 /dev/zram0
sudo swapon --priority 100 /dev/zram0
sudo nano /etc/systemd/system/zram.service
put this scripts
[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
and saved it
sudo systemctl enable zram
sudo modprobe zram
and then
sudo sh -c "echo 'lz4' > /sys/block/zram0/comp_algorithm"
You can change it what you want
2G or 4G
sudo sh -c "echo '2G' > /sys/block/zram0/disksize"
sudo mkswap --label zram0 /dev/zram0
sudo swapon --priority 100 /dev/zram0
Turne on Automatically zRam swap on the startup
sudo nano /etc/systemd/system/zram.service
put this scripts
[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
and saved it
sudo systemctl enable zram
No comments:
Post a Comment