婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > Linux系統(tǒng)中的內(nèi)存清理和釋放命令歸納小記

Linux系統(tǒng)中的內(nèi)存清理和釋放命令歸納小記

熱門標(biāo)簽:江蘇小型外呼系統(tǒng)軟件 常熟外呼系統(tǒng) 拉薩銷售外呼系統(tǒng)軟件 文山外呼營銷系統(tǒng) 電話機(jī)器人服務(wù)器部署 電銷語音機(jī)器人哪個好 百度地圖標(biāo)注未成功 中山防封卡電銷卡辦理 地圖上標(biāo)注點(diǎn)位的圖標(biāo)

# 清理步驟
# 清理前內(nèi)存使用情況
 

復(fù)制代碼
代碼如下:
free -m

# 開始清理
 

復(fù)制代碼
代碼如下:
echo 1 > /proc/sys/vm/drop_caches

# 清理后內(nèi)存使用情況
 

復(fù)制代碼
代碼如下:
free -m

完成!

# 查看內(nèi)存條數(shù)命令:
 

復(fù)制代碼
代碼如下:
dmidecode | grep -A16 "Memory Device$"
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
sync

# 釋放前最好sync一下,防止丟數(shù)據(jù)。因?yàn)長INUX的內(nèi)核機(jī)制,一般情況下不需要特意去釋放已經(jīng)使用的cache。這些cache起來的內(nèi)容可以增加文件以及的讀寫速度。
# 先說下free命令怎么看內(nèi)存

 

復(fù)制代碼
代碼如下:
$free
total used free shared buffers cached
Mem: 1535052 918928 616124 0 2512 82964
-/+ buffers/cache: 833452 701600
Swap: 0 0 0

# 第一行用全局角度描述系統(tǒng)使用的內(nèi)存狀況:
total——總物理內(nèi)存
used——已使用內(nèi)存,一般情況這個值會比較大,因?yàn)檫@個值包括了cache+應(yīng)用程序使用的內(nèi)存
free——完全未被使用的內(nèi)存
shared——應(yīng)用程序共享內(nèi)存
buffers——緩存,主要用于目錄方面,inode值等(ls大目錄可看到這個值增加)
cached——緩存,用于已打開的文件
total = used + free
used = buffers+cached (maybe add shared also)
第二行描述應(yīng)用程序的內(nèi)存使用:
前個值表示-buffers/cache——應(yīng)用程序使用的內(nèi)存大小,used減去緩存值
后個值表示+buffers/cache——所有可供應(yīng)用程序使用的內(nèi)存大小,free加上緩存值
-buffers/cache=used-buffers-cached
+buffers/cache=free+buffers+cached
第三行表示swap的使用:
used——已使用
free——未使用
手動執(zhí)行sync命令(描述:sync 命令運(yùn)行 sync 子例程。如果必須停止系統(tǒng),則運(yùn)行 sync 命令以確保文件系統(tǒng)的完整性。sync 命令將所有未寫的系統(tǒng)緩沖區(qū)寫到磁盤中,包含已修改的 i-node、已延遲的塊 I/O 和讀寫映射文件)
echo 3 > /proc/sys/vm/drop_caches
cat /proc/sys/vm/drop_caches
3
!將/proc/sys/vm/drop_caches值設(shè)為3

# 有關(guān)/proc/sys/vm/drop_caches的用法在下面進(jìn)行了說明
 

復(fù)制代碼
代碼如下:
/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 gt; /proc/sys/vm/drop_caches; to
free dentries and inodes, use echo 2 gt; /proc/sys/vm/drop_caches;
to free pagecache, dentries and inodes, use echo 3 gt;
/proc/sys/vm/drop_caches.
Because this is a non-destructive operation and dirty objects
# 原文鏈接:a >http://levi.cg.am/?p=3224/a>

標(biāo)簽:法律問答 馬鞍山 淮安 湖南 和田 和田 開封 石家莊

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux系統(tǒng)中的內(nèi)存清理和釋放命令歸納小記》,本文關(guān)鍵詞  Linux,系統(tǒng),中的,內(nèi)存,清理,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Linux系統(tǒng)中的內(nèi)存清理和釋放命令歸納小記》相關(guān)的同類信息!
  • 本頁收集關(guān)于Linux系統(tǒng)中的內(nèi)存清理和釋放命令歸納小記的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 阜新市| 鹤峰县| 托里县| 泗阳县| 民乐县| 富民县| 蓬莱市| 宜川县| 华池县| 盐池县| 台湾省| 抚松县| 怀安县| 泉州市| 邛崃市| 会宁县| 和静县| 镇巴县| 左云县| 黄平县| 谢通门县| 梁河县| 铜鼓县| 溆浦县| 子长县| 武宁县| 崇阳县| 清镇市| 扎赉特旗| 社旗县| 武汉市| 乐安县| 礼泉县| 泉州市| 合山市| 尼勒克县| 缙云县| 中西区| 溧阳市| 湖南省| 旌德县|