LoginSignup
41
43

More than 5 years have passed since last update.

swapしちゃった時の開放

Posted at

どうでもいいことでもQiitaに入れてみよう実験。
メモメモ。

Swapしちゃった時に開放したい場合。

swapoff -a
swapon -a

もしくは、

sync;echo "3" > /proc/sys/vm/drop_caches
echo "0" > /proc/sys/vm/drop_caches

で。
もちろん元になったプロセスとかはなんとかしましょうね(;´∀`)

解放前

$ free -m
             total       used       free     shared     buffers     cached
Mem:         16041      13577       2464          0        134       5042
-/+ buffers/cache:       8400       7641
Swap:         2047        202       1845

解放後

$ free -m
             total       used       free     shared    buffers     cached
Mem:         16041      12776       3265          0        134       4638
-/+ buffers/cache:       8003       8038
Swap:         2047          0       2047
41
43
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
41
43