Clear Memory Cache Linux Server

drop_caches

Since Kernel 2.6.16, you can control how cache behaves, there are four possible “positions” for the switch.

0 -> Will give the Kernel full control to the cache memory 1 -> Will free the page cache 2 -> Will free dentries and inodes 3 -> Will free dentries and inodes as well as page cache

So, just enter those values to the file /proc/sys/vm/drop_caches, with echo, and as root:

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

Ok sekarang mari kita lihat contohnya pada ubuntu 12.04 64 Bit yang saya pakai

Perhatikan Gambar Shell di bawah

cachebeforeBuffers 1233427 K sebelum di lakukan drop cache memory

AfterDropCacheMem

setelah saya jalankan perintah berikut dengan aksess root pada terminal   :

echo 3 > /proc/sys/vm/drop_caches , lihat free buffers sudah berubah 

semoga bermanfaat

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s