亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1407 | 回復(fù): 0
打印 上一主題 下一主題

實(shí)用技巧:Linux操作系統(tǒng)釋放cache內(nèi)存 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2010-02-03 11:13 |只看該作者 |倒序?yàn)g覽
/proc是個(gè)虛擬文檔系統(tǒng),我們能夠通過對(duì)他的讀寫操作做為和kernel實(shí)體間進(jìn)行通信的一種手段.也就是說能夠通過修改/proc中的文檔,來對(duì)當(dāng)前kernel的行為做出調(diào)整.那么我們能夠通過調(diào)整/proc/sys/vm/drop_caches來釋放內(nèi)存.操作如下:
  [root@server test]# cat /proc/sys/vm/drop_caches
  0
  首先,/proc/sys/vm/drop_caches的值,默認(rèn)為0
  [root@server test]# sync
  手動(dòng)執(zhí)行sync命令(描述:sync 命令運(yùn)行 sync 子例程。假如必須停止系統(tǒng),則運(yùn)行 sync 命令以確保文檔系統(tǒng)的完整性。sync 命令將任何未寫的系統(tǒng)緩沖區(qū)寫到磁盤中,包含已修改的 i-node、已延遲的塊 I/O 和讀寫映射文檔)
  [root@server test]# echo 3 > /proc/sys/vm/drop_caches
  [root@server test]# cat /proc/sys/vm/drop_caches
  3
  將/proc/sys/vm/drop_caches值設(shè)為3
  [root@server test]# free -m
  total used free shared buffers cached
  Mem: 249 66 182 0 0 11
  -/+ buffers/cache: 55 194
  Swap: 511 0 511
  再來運(yùn)行free命令,發(fā)現(xiàn)現(xiàn)在的used為66MB,free為182MB,buffers為0MB,cached為11MB.那么有效的釋放了buffer和cache.
  有關(guān)/proc/sys/vm/drop_caches的用法在下面進(jìn)行了說明
  /proc/sys/vm/drop_caches (since Linux 2.6.16)
  Writing to this file causes the kernel to drop clean caches,
  dentries and inodes from memory, causing that memory to become
  free.
  To free pagecache, use echo 1 > /proc/sys/vm/drop_caches; to
  free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches;
  to free pagecache, dentries and inodes, use echo 3 >
  /proc/sys/vm/drop_caches.
  Because this is a non-destructive operation and dirty objects
  are not freeable, the user should run sync(8) first.

本文來自ChinaUnix博客,如果查看原文請點(diǎn):http://blog.chinaunix.net/u/19273/showart_2170002.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP