rekees2020
deepin
2020-07-22 05:06 zram的大小并不是直接独占,而是动态分配,这样也不用担心浪费内存
Reply Like 0 View the author
https://bbs.deepin.org/post/197502
建议官方集成到系统里,
我先来
圣上请采纳吾等建议

。。真的挺好的功能https://bbs.deepin.org/post/197502
如果上nvme协议的固态硬盘
是不是就不卡了?
https://bbs.deepin.org/post/197502
我用的.M2固态硬盘,会卡
nvme固态硬盘不知道,但swap到任何固态硬盘都肯定没有swap到内存快
https://bbs.deepin.org/post/197502
问一下,休眠功能。。。。swap为啥能带来休眠功能,什么是休眠功能
https://bbs.deepin.org/post/197502
查了一下 arch wiki,5.7+的内核默认启用了zswap
https://bbs.deepin.org/post/197502
就是把内存里的数据全部写入硬盘,在Linux系统中,就是写入硬盘上的swap分区或文件
而swap另外一个作用是 ...
https://bbs.deepin.org/post/197502
就是把内存里的数据全部写入硬盘,在Linux系统中,就是写入硬盘上的swap分区或文件
而swap另外一个作用是 ...
https://bbs.deepin.org/post/197502
swap是不是就是书上说的虚拟地址的存储位置啊
https://bbs.deepin.org/post/197502
其实卡,是给人的感觉,鼠标移不动,窗口打不开这些都会让人觉得卡,要解决的是这些现象,如果IO的优先级略 ...
zswap就是系统要进行swap的时候,先把要swap的数据压缩一下放在内存里,能减少对硬盘swap的读写,提高性能
zram是在内存中虚拟一个swap设备,也能提高性能
zswap用swap-control-gui直接设置,作者几年前在社区里发过
但是这个软件在deepin 20上无法设置zram
可以用以下方法设置zram--
(如果同时有用于休眠的swap分区,其优先级会高于zram,理论上可以修改/etc/fstab,降低swap分区优先级,但我机器上这样设置不生效,swap分区优先级为-2,zram优先级为-3,zram形同虚设,可以写开机自动运行脚本,用swapoff和swapon命令关闭再打开swap分区,这样zram优先级就成-2,swap分区优先级就成-3)
How to enable zRAM
The zRAM module is controlled by systemd, so there's no need for an fstab entry. And since everything is already installed out of the box, we only need to create a few files and modify one.
Open a terminal window and create a new file with the command:
sudo nano /etc/modules-load.d/zram.conf
In that file, add the word:
zram
Save and close the file.
Next, create a second new file with the command:
sudo nano /etc/modprobe.d/zram.conf
In that file, paste the line:
options zram num_devices=1
Save and close the file.
Next, we need to configure the size of the zRAM partition. Create a new file with the command:
sudo nano /etc/udev/rules.d/99-zram.rules
In that file, paste the following (modifying the disksize attribute to fit your needs):
KERNEL=="zram0", ATTR{disksize}="512M",TAG+="systemd"
Save and close the file.
In order for zRAM to run, we need to create a systemd unit file. Create this file with the command:
sudo nano /etc/systemd/system/zram.service
In that file, paste the following contents:
[Unit]Description=Swap with zramAfter=multi-user.target[Service]Type=oneshot RemainAfterExit=trueExecStartPre=/sbin/mkswap /dev/zram0ExecStart=/sbin/swapon /dev/zram0ExecStop=/sbin/swapoff /dev/zram0[Install]WantedBy=multi-user.target
Save and close the file.
Enable the new unit with the command:
sudo systemctl enable zram
Reboot the machine.
How to find out if zRAM is working
Once the system reboots, log back in. From a terminal window, issue the command:
cat /proc/swaps