API获取当前进程的内存信息
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了API获取当前进程的内存信息相关的知识,希望对你有一定的参考价值。
PROCESS_MEMORY_COUNTERS ProMem = {0};
ProMem.cb = sizeof(PROCESS_MEMORY_COUNTERS);
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,FALSE,GetCurrentProcessId());
GetProcessMemoryInfo(hProcess,&ProMem,sizeof(ProMem));
CloseHandle(hProcess);
typedef struct _PROCESS_MEMORY_COUNTERS {
DWORD cb;
DWORD PageFaultCount;
SIZE_T PeakWorkingSetSize;
SIZE_T WorkingSetSize;
SIZE_T QuotaPeakPagedPoolUsage;
SIZE_T QuotaPagedPoolUsage;
SIZE_T QuotaPeakNonPagedPoolUsage;
SIZE_T QuotaNonPagedPoolUsage;
SIZE_T PagefileUsage;
SIZE_T PeakPagefileUsage;
} PROCESS_MEMORY_COUNTERS;
以上是关于API获取当前进程的内存信息的主要内容,如果未能解决你的问题,请参考以下文章