一、開發環境
開發環境:Ubuntu16.04
二、設定虛擬記憶體
1、新建記憶體
新建16G記憶體 ,一般為真機的兩倍
sudo fallocate -l 16G /icedustpan
2、查看虛擬記憶體
ls -lh /icedustpan
可以看到一個16G的虛擬記憶體檔案

3、設定虛擬記憶體權限
sudo chmod 600 /icedustpan
可以看到已經成功設定權限

4、掛載虛擬記憶體
sudo mkswap /icedustpan

5、啟用虛擬記憶體
sudo swapon /icedustpan
6、查看虛擬記憶體
swapon -s

可以看到有一個16G的記憶體空間
7、設定自動掛載虛擬記憶體
sudo vi /etc/fstab
在最后面加入下列的資訊
/icedustpan none swap sw 0 0

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/104525.html
標籤:其他
