The memory usage of the Windows Server 2008 R2 server is too high, but it is inconsistent with the memory occupied by the process in the task manager

System environment:
Windows Server 2008 R2 + Sql Server 2008 R2
 
Problem Description:
The memory usage of the Windows Server 2008 R2 system is too large, and the total memory usage of each process in the task manager is far less than this.
Related phenomena:
1. Memory usage rate is over 90%
2. The memory of all processes in the task manager is low, far less than 90%, and there are more than 20 G of memory deviation
 
Analysis process:
 
  1. First suspect the memory consumption of SQL Server, but SQL Server has set the maximum memory, and the memory ratio displayed in the task manager has not reached a very high, rule out this reason
  2. Use the RamMap tool to check the detailed memory usage and find that the metafile (Metafile) occupies more than 20 G of memory, which should be related
 
Solution: Use RamMap's "Empty System Working Set" function to free up memory.
 

 

 

 

 

Metafile (Metafile):
     Metafile can be understood as a system cache. In the Windows server 2008 system, for example, there are a large number of file copies and other disk io operations, the system will automatically cache it in memory. This part of the occupied memory is not reflected in the task manager. , So users will think that the system's memory usage is abnormal. At the same time, MetaFile has no limit by default, so the system will occupy memory unlimitedly. But after Windows 2012, the operating system will automatically limit the upper limit of the system cache to avoid the exhaustion of physical memory.
    After reading the explanation of the metafile, I found that I had been doing file transfer operations for the first two days. A large number of small files of hundreds of gigabytes were transferred on different disks, which led to excessive memory usage, which is consistent with this explanation. At this point, the problem is clearly investigated.
 
The following is the method of modifying the registry to limit the dynamic cache in the official Microsoft blog:
Microsoft Windows Dynamic Cache update program, users can download it and add it to the service, modify the registry to limit the maximum value of the dynamic cache, such as setting the upper limit to 200M, etc., so that the system can set the upper limit of the memory used as cache value.
The specific setting steps are as follows:
1. After decompression, copy it to C: \ windows \ system32 according to the corresponding DynCache.exe file in different system versions.
2. Open a command prompt as an administrator and execute the following commands to add services:
      sc create DynCache binPath= %SystemRoot%\System32\DynCache.exe start= auto type= own DisplayName= "Dynamic Cache Service"
3. Go back to the DynCache folder and find the DynCache.reg registry file to import.
4. Open the registry and find HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ DynCache \ Parameters
5. Find MaxSystemCacheMBytes on the right, double-click it, here we select "decimal", enter the maximum number of caches (in MB) in the value, enter 800 to limit the maximum cache to 800MB, and enter 0 to not limit.
6. Go to the service and start the DynCache service.
Note: There are several versions available for decompressing the downloaded dyncache. Please choose the retail amd64 version instead of ia64 (ia64 represents Itanium's 64-bit processor version).
 
 
Windows Server 2008 R2 + Sql Server 2008 R2
 
Problem Description:
The memory usage of the Windows Server 2008 R2 system is too large, and the total memory usage of each process in the task manager is far less than this.
Related phenomena:
1. Memory usage rate is over 90%
2. The memory of all processes in the task manager is low, far less than 90%, and there are more than 20 G of memory deviation
 
Analysis process:
 
  1. First suspect the memory consumption of SQL Server, but SQL Server has set the maximum memory, and the memory ratio displayed in the task manager has not reached a very high, rule out this reason
  2. Use the RamMap tool to check the detailed memory usage and find that the metafile (Metafile) occupies more than 20 G of memory, which should be related
 
Solution: Use RamMap's "Empty System Working Set" function to free up memory.
 

 

 

 

 

Metafile (Metafile):
     Metafile can be understood as a system cache. In the Windows server 2008 system, for example, there are a large number of file copies and other disk io operations, the system will automatically cache it in memory. This part of the occupied memory is not reflected in the task manager. , So users will think that the system's memory usage is abnormal. At the same time, MetaFile has no limit by default, so the system will occupy memory unlimitedly. But after Windows 2012, the operating system will automatically limit the upper limit of the system cache to avoid the exhaustion of physical memory.
    After reading the explanation of the metafile, I found that I had been doing file transfer operations for the first two days. A large number of small files of hundreds of gigabytes were transferred on different disks, which led to excessive memory usage, which is consistent with this explanation. At this point, the problem is clearly investigated.
 
The following is the method of modifying the registry to limit the dynamic cache in the official Microsoft blog:
Microsoft Windows Dynamic Cache update program, users can download it and add it to the service, modify the registry to limit the maximum value of the dynamic cache, such as setting the upper limit to 200M, etc., so that the system can set the upper limit of the memory used as cache value.
The specific setting steps are as follows:
1. After decompression, copy it to C: \ windows \ system32 according to the corresponding DynCache.exe file in different system versions.
2. Open a command prompt as an administrator and execute the following commands to add services:
      sc create DynCache binPath= %SystemRoot%\System32\DynCache.exe start= auto type= own DisplayName= "Dynamic Cache Service"
3. Go back to the DynCache folder and find the DynCache.reg registry file to import.
4. Open the registry and find HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ DynCache \ Parameters
5. Find MaxSystemCacheMBytes on the right, double-click it, here we select "decimal", enter the maximum number of caches (in MB) in the value, enter 800 to limit the maximum cache to 800MB, and enter 0 to not limit.
6. Go to the service and start the DynCache service.
Note: There are several versions available for decompressing the downloaded dyncache. Please choose the retail amd64 version instead of ia64 (ia64 represents Itanium's 64-bit processor version).

Guess you like

Origin www.cnblogs.com/magita/p/12752603.html