增加SWAP的大小
建立512M的檔案swaptest。
# dd if=/dev/zero of=/swaptest bs=1024 count=524288
524288+0 records in
524288+0 records out
536870912 bytes (537 MB) copied, 6.971 s, 77.0 MB/s
設定 /swaptest 為 swap,參數-f為force
# mkswap -f /swaptest
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=c65946cf-6c09-431a-a884-1015bdaec7bf
先檢查目前swap的大小
#free |grep Swap
Swap: 2097144 0 2097144 <-- swap的容量為2G
啟用 /swaptest
# swapon /swaptest
再檢查swap的大小
#free |grep Swap
Swap: 2621424 0 2621424 <--增加了256MB
關閉 /swaptest
#swapoff /swaptest
如果想永遠都使用swap檔案,則編輯 /etc/fstab 加入以下設定:
/swaptest swap swap defaults 0 0
-
Windows7 / Windows8 kill process Linux下要刪除某個程序通常會使用 ps 配合 kill 來刪除程序。 例如:ps -ef |grep [PROCESS NAME] kill -9 [PID] 在Windows下,通常是...
-
利用Win 10的工作排程器來設定每日自動執行的批次檔,單獨執行批次檔沒問題,但是放在排程上就是無法執行。 後來試了幾種網路上提供的方式,其注意的事項如下: 1、在「安全性選項」選擇「只有使用者登入時才執行」並取消「以最高權限執行」。 2、在「設定」中選擇「Win...
-
其實預設都會幫我們安裝pip這個管理套件,但是我在安裝完python 3.7後卻無法使用pip來安裝套件。 查詢是否已經有安裝pip: C:\> python -m pip --version pip 20.0.2 from C:\Python37\lib\si...