溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

windows2008內(nèi)存使用過高問題

發(fā)布時間:2020-07-19 08:26:22 來源:網(wǎng)絡(luò) 閱讀:3488 作者:老逗先生 欄目:系統(tǒng)運(yùn)維

最近一段時間發(fā)現(xiàn)業(yè)務(wù)的一臺機(jī)器windos2008的可使用內(nèi)存持續(xù)降低,今天已經(jīng)降低到2G。
計算了跑著的進(jìn)程的內(nèi)存和,發(fā)現(xiàn)與實際不符(不知道那剩余的4G跑哪去了)
后來使用了RAMMap v1.51進(jìn)行分析內(nèi)存,下載地址,請點(diǎn)擊此處

分析發(fā)現(xiàn)

windows2008內(nèi)存使用過高問題

Mapped file占用大量內(nèi)存4G,根據(jù)微軟官網(wǎng)給出的解釋:
You experience performance issues in applications and services in various versions of Windows XP, Windows Vista, Windows Server 2003, Windows Server 2008, and Windows Server 2008 R2. Additionally, you notice the following symptoms:
1)Available memory is almost exhausted.
2)The system file cache consumes most of the physical RAM.
3)There is a continuous and high volume of cached read requests to the hard disk.

If there is a continuous and high volume of cached read requests from any process or from any driver, the working set size of the system file cache will grow to meet this demand. The system file cache consumes the physical RAM. Therefore, sufficient amounts of physical RAM are not available for other processes
也就是說文件系統(tǒng)的緩存沒有做限制導(dǎo)致,持續(xù)增加文件系統(tǒng)的緩存持續(xù)占有物理內(nèi)存。

解決方案:
官方提供的解決方案是做內(nèi)存的限制(不允許占有的內(nèi)存持續(xù)增加)

安裝Windows Dynamic Cache Service,下載地址點(diǎn)擊此處
注冊服務(wù)
Dynamic Cache Registry settings,這里我設(shè)置了10G(物理內(nèi)存12G)

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DynCache\Parameters]
"MaxSystemCacheMBytes"=dword:00002800
"MinSystemCacheMBytes"=dword:00000064
"SampleIntervalSecs"=dword:0000003c
"CacheUpdateThresholdMBytes"=dword:00000064
只需設(shè)置MaxSystemCacheMBytes,這里設(shè)置為10G

在服務(wù)中啟動Dynamic Cache服務(wù)。注意:需要重啟應(yīng)用。

關(guān)鍵詞說明:
Process Private: 分配給單一Process專用的內(nèi)存
Mapped File: 用來儲放檔案內(nèi)容快取(Cache)的內(nèi)存空間
Shared Memory: 標(biāo)注給多個Process共用的內(nèi)存分頁(Page,內(nèi)存管理單位)
Page Table: 用來描述虛擬內(nèi)存位址的分頁表(裡面是一筆一筆的PTE,Page Table Entries)
Paged Pool: 允許移至硬盤的核心集區(qū)內(nèi)存(Kernal Pool Memory)
Nonpaged Pool: 不允許移至硬盤的核心集區(qū)內(nèi)存
System PTEs: 與I/O空間、核心堆疊、內(nèi)存描述清單等系統(tǒng)分頁相關(guān)的PTE
Session Private: 登入工作階段相關(guān)的內(nèi)存
Metafile: 是系統(tǒng)快取的一部份,包含NTFS Metadata(包含MFT及其他NTFS Metadata檔案)。在MFT中,每個檔案屬性記錄佔(zhàn)用1K,而一個檔案至少有一個屬性記錄,再加上其他NTFS Metadata檔,當(dāng)檔案數(shù)眾多,這塊會很快速成長。
AWE: 啟用Address Windowing Extension技術(shù)所使用的相關(guān)內(nèi)存空間(較常應(yīng)用在SQL或其他DB)
Driver Locked: 驅(qū)動程式鎖定的實體內(nèi)存。多用于I/O的暫時性小量應(yīng)用,如果有裝RAMDisk,也會算在這一區(qū)。
Kernel Stack: 核心執(zhí)行緒推疊,執(zhí)行緒愈多,用量愈大。

每項分類都有以下欄位:

Active: 正在使用中的實體內(nèi)存分頁(Process Working Set或System Working Set)
Standby: 留在實體內(nèi)存但暫不使用的分頁,保留供后續(xù)能快速重覆利用
Modified: 與Standy類似,但內(nèi)容被修改過,重覆使用前要先回寫到硬盤機(jī)
Modified no write: 與Modified類似,但標(biāo)注為不需回寫到硬盤
Transition: 在分類之間轉(zhuǎn)換的分頁
Zeroed: 內(nèi)容已清空可供使用的分頁,系統(tǒng)剛開機(jī)時明顯增加,隨著使用一段時間逐步轉(zhuǎn)為Standby
Free: 可以使用但殘留先前資料的分頁,使用前需先轉(zhuǎn)為Zeroed
Bad: 標(biāo)注損壞的內(nèi)存
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI