學習啦 > 學習電腦 > 操作系統(tǒng) > 系統(tǒng)優(yōu)化教程 > linux系統(tǒng)清理緩存教程

linux系統(tǒng)清理緩存教程

時間: 志藝942 分享

linux系統(tǒng)清理緩存教程

  今天用spot on light 查了一下開發(fā)服務器的內(nèi)存占用,只剩下60MB,用下面的方法就可以實現(xiàn)清空緩存頻繁的文件訪問會導致系統(tǒng)的Cache使用量大增。接下來是小編為大家收集的linux系統(tǒng)清理緩存教程,歡迎大家閱讀:

  linux系統(tǒng)清理緩存教程

  命令

  #sync

  #echo 3 > /proc/sys/vm/drop_caches

  查看內(nèi)存情況:

  # more /proc/meminfo

  Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...

  To use /proc/sys/vm/drop_caches, just echo a number to it.

  To free pagecache:

  # echo 1 > /proc/sys/vm/drop_caches

  To free dentries and inodes:

  # echo 2 > /proc/sys/vm/drop_caches

  To free pagecache, dentries and inodes:

  echo 3 > /proc/sys/vm/drop_caches

  This is a non-destructive operation and will only free things that are completely unused. Dirty objects will continue to be in use until written out to disk and are not freeable. If you run "sync" first to flush them out to disk, these drop operations will tend to free more memory.

 
 看了“linux系統(tǒng)清理緩存教程”還想看:

1.清理Linux系統(tǒng)垃圾文件操作方法圖文步驟詳解

2.怎樣清理Linux系統(tǒng)的垃圾文件

3.Linux系統(tǒng)怎樣清理垃圾文件

4.Linux如何手動清理內(nèi)存中cache信息

3042707