After some problems with running out of memory with a 32-bit process on Windows, I started using Performance Monitor to log specific counters for this process.
Although it is normal that virtual bytes are higher than both private bytes and working set, I found that in my case, the significant difference in Virtual Btes was much higher than that of private bytes and working set.
What specific operations and functions of Win32 / CRT (in C or C ++) will increase virtual bytes, but not private bytes and working set?
I assume that these will be some common resources, if I understand the description of different counters in Performance Monitor.
It seems that there is some (at least) confusion in the naming convention for use in memory calculations in different versions of Windows, as well as in different applications in the same version of Windows, I put together the following:
Information from MSDN
According to MSDN - memory limits for a Windows release , the 32-bit Windows user mode virtual address space limit for each 32-bit process is usually 2 GB. It can be up to 3 GB with IMAGE_FILE_LARGE_ADDRESS_AWAREand 4GT.
The following is a description of the various counters in the performance monitor along with the corresponding columns in the task manager and the Win32 structure, which contains information in accordance with the MSDN - Memory Performance Information .
Virtual bytes
- , . . , .
XP: N/A
Vista: N/A
: MEMORYSTATUSEX.ullTotalVirtual-MEMORYSTATUSEX.ullAvailVirtual
- , , .
XP:
Vista:
: PROCESS_MEMORY_COUNTERS_EX.PrivateUsage
- . - , . , , . , . , .
XP: Mem
Vista:
: PROCESS_MEMORY_COUNTERS_EX.WorkingSetSize