A good starting point would be GetProcessMemoryInfo, which reports various memory info about the specified process. You can pass GetCurrentProcess()
as the process handle in order to get information about the calling process.
Probably the WorkingSetSize
member of PROCESS_MEMORY_COUNTERS
is the closest match to the Mem Usage coulmn in task manager, but it's not going to be exactly the same. I would experiment with the different values to find the one that's closest to your needs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…