2

Under windows, given a PID:

1) How to get the exact memory in bytes and
2) The exact CPU usage

consumed by that application right now?

nh2
  • 24,526
  • 11
  • 79
  • 128
Luka
  • 1,761
  • 2
  • 19
  • 30

1 Answers1

2
  1. See GetProcessMemoryInfo, and specifically the WorkingSetSize field of the out parameter.
  2. GetProcessTimes will let you know how much time your process has spent altogether in user & kernel space. It's up to you to calculate percentages, or whatever you want out of it.
Yam Marcovic
  • 7,953
  • 1
  • 28
  • 38