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
  • 23,181
  • 11
  • 69
  • 117
Luka
  • 1,691
  • 1
  • 19
  • 29

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,731
  • 1
  • 27
  • 38