34 GB of commited memory but no app actually commited that much

发布时间 2023-09-28 16:09:28作者: 不及格的程序员-八神
Asked 3 years, 8 months ago
Viewed 493 times
 
3

Sometimes I encounter Out of memory errors and Windows Event Viewer shows this (translated):

Resource-Exhaustion-Detector: A lack of virtual memory in the system was successfully detected. The largest amount of virtual memory was allocated to the following programs: 10582573056 bytes were allocated for myapp.exe (12412), 916819968 bytes were allocated for firefox.exe (18240) and 794206208 bytes were allocated for firefox.exe (13724).

myapp.exe allocated 10 GB, Firefox.exe-s allocated totally ~4.5 GB, some other stuff 10x150MB (as I check later in Task Manager), so total commit should be 16 GB but since I receive these lack of memory warning I assume that the real commit is about 34 GB (32 GB of RAM + 2 GB pagefile).

What could be that hidden thing with big commit that is neither shown in Task Manager processes nor reported by Resource-Exhaustion-Detector?

Is cached memory shown in Task Manager counted towards commited? If counted then why isn't it freed when another app tries to allocate for its needs (as I understand cached memory just fills not used RAM and should be immediately freed when that memory is required)?

Here is a screenshot of different time when Task Manager shows 19.3 GB commited but if I sum everything in allocated column in Details tab it's ~14.3 GB, not 19.3. 

 

Update

This is not a duplicate of Resource-Exhaustion-Detector: out of virtual memory, but plenty of RAM available

In that previous question I asked why I receive out of memory when I have free RAM, now I know the answer - because I'm out of commited memory. Now I'm asking why I'm running of commited memory while no app actually commits that much. They are different.

None of these either answer my question because they are about having physical memory free but receiving Out of memory errors, but I'm asking about reasons why I have no free virtual memory:

  •  
    @Vlad Much better. I've reopened this one for you. 
    – DavidPostill
     Jan 12, 2020 at 13:21
  •  
    When looking at the processes and their memory consumption I would recommend to use Sysinternals Process Explorer instead of the TaskManager and enable all the different memory columns. This tool also has the advantage that it does not suffer from any translation (usually more on obfuscation that a translation). 
    – Robert
     Jan 12, 2020 at 14:00
  •  
    Your pagefile is extremely small. It is normally recommended for it to be the size of the RAM. How are you getting the numbers for the programs? 
    – harrymc
     Jan 12, 2020 at 14:10
  •  
    @harrymc I summed Task Manager's allocated column. Now rechecked with sum of PagedMemorySize in PowerShell and it's 17 GB commited by processes (of 22 GB total commited). 
    – Vlad
     Jan 12, 2020 at 14:21 
  •  
    @Vlad - Have you set the size of allow Windows to set the size?   Jan 12, 2020 at 14:35