How to determine a process “virtual size” (WinXP)?

前端 未结 6 1614
渐次进展
渐次进展 2020-12-31 12:27

I have a program that needs a lot of memory, and it crashes as soon as the 2GB virtual address space is reached. Sysinternals process explorer displays this as \"virtual si

6条回答
  •  时光取名叫无心
    2020-12-31 13:15

    According to MSDN: Memory Performance Information PROCESS_MEMORY_COUNTERS_EX.PrivateUsage is the same as VM Size in Task Manager in Windows XP. GetProcessMemoryInfo should work:

    PROCESS_MEMORY_COUNTERS_EX pmcx = {};
    pmcx.cb = sizeof(pmcx);
    GetProcessMemoryInfo(GetCurrentProcess(),
        reinterpret_cast(&pmcx), pmcx.cb);
    

    Now pmcx.PrivateUsage holds the VM Size of the process.

提交回复
热议问题