mirror of
http://junepve.top:3000/chicrobot/README.git
synced 2026-10-29 22:31:29 +08:00
更新 b3_ubuntu创建交换内存.md
This commit is contained in:
1 parent
8a6a888534
commit
451d02148a
1 file changed
+26
@@ -72,3 +72,29 @@ vfs_cache_pressure 控制内核回收用于缓存目录和 inode 对象的内存
|
||||
vm.vfs_cache_pressure=50
|
||||
```
|
||||
保存后,同样运行`sudo sysctl -p`来应用。
|
||||
|
||||
|
||||
# 修改交换内存
|
||||
查看原本的交换空间
|
||||
```
|
||||
sudo swapon --show
|
||||
```
|
||||
停止并删除原本的交换内存
|
||||
```
|
||||
sudo swapoff /swapfile
|
||||
sudo rm /swapfile
|
||||
```
|
||||
创建新的文件
|
||||
```
|
||||
sudo fallocate -l 6G /swapfile
|
||||
```
|
||||
设置权限并格式化
|
||||
```
|
||||
sudo chmod 600 /swapfile
|
||||
sudo mkswap /swapfile
|
||||
```
|
||||
启用并确认
|
||||
```
|
||||
sudo swapon /swapfile
|
||||
free -h
|
||||
```
|
||||
Reference in new issue
Block a user