|
最近一段时间发现业务的一台机器windos2008的可使用内存持续降低,今天已经降低到2G。
计算了跑着的进程的内存和,发现与实际不符(不知道那剩余的4G跑哪去了)
后来使用了RAMMap v1.51进行分析内存,下载地址,请点击此处
分析发现
Mapped file占用大量内存4G,根据微软官网给出的解释:
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
也就是说文件系统的缓存没有做限制导致,持续增加文件系统的缓存持续占有物理内存。
解决方案:
官方提供的解决方案是做内存的限制(不允许占有的内存持续增加)
安装Windows Dynamic Cache Service,下载地址点击此处
注册服务
Dynamic Cache Registry settings,这里我设置了10G(物理内存12G)
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DynCache\Parameters]
"MaxSystemCacheMBytes"=dword:00002800
"MinSystemCacheMBytes"=dword:00000064
"SampleIntervalSecs"=dword:0000003c
"CacheUpdateThresholdMBytes"=dword:00000064
只需设置MaxSystemCacheMBytes,这里设置为10G
在服务中启动Dynamic Cache服务。注意:需要重启应用。
|
|