Today I noticed that something is eating my RAM like crazy. After I checked with
$watch -n 3 cat /proc/meminfo
it turned out something is caching huge memory for no good reason. So this is what I did (source):
$sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
and it immediately released like 7GB of RAM. Which is quite a lot. And nothing has crashed so far.
Obviously (from here) you can also do is only partially:
$sudo sh -c "sync; echo 1 > /proc/sys/vm/drop_caches"
$sudo sh -c "sync; echo 2 > /proc/sys/vm/drop_caches"
I haven't yet tried them, because it seemed I need to drop everything.
A side thing - I just discovered (well, by googling it) that if you type shift +E while in top, you can change the units from KB to GB. Which is much easier to read. Yay!
$watch -n 3 cat /proc/meminfo
it turned out something is caching huge memory for no good reason. So this is what I did (source):
$sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
and it immediately released like 7GB of RAM. Which is quite a lot. And nothing has crashed so far.
Obviously (from here) you can also do is only partially:
$sudo sh -c "sync; echo 1 > /proc/sys/vm/drop_caches"
$sudo sh -c "sync; echo 2 > /proc/sys/vm/drop_caches"
I haven't yet tried them, because it seemed I need to drop everything.
A side thing - I just discovered (well, by googling it) that if you type shift +E while in top, you can change the units from KB to GB. Which is much easier to read. Yay!
Няма коментари:
Публикуване на коментар