0

As I mentioned I dont know how to get memory usage of executed program by gcc/g++ compiler of MinGW under windows. Is there a function like time from Linux on Windows. I tried Measure Command but not showing memory. MinGw under Windows 10

For any responses Very Thankful

MSWA
  • 37
  • 1
  • 11
  • Possible duplicate of [How much stack and heap (in bytes) is required by the C function in X86](https://stackoverflow.com/questions/54001978/how-much-stack-and-heap-in-bytes-is-required-by-the-c-function-in-x86) – Duck Dodgers Jan 09 '19 at 08:15
  • And this [question](https://stackoverflow.com/questions/28488554/how-to-measure-a-functions-stack-usage-in-c). – Duck Dodgers Jan 09 '19 at 08:16
  • and [this](https://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process)! – Duck Dodgers Jan 09 '19 at 08:17
  • not answered my questions – MSWA Jan 09 '19 at 13:31

1 Answers1

0

You can do this per process using GetProcessMemoryInfo(), see: https://learn.microsoft.com/en-us/windows/win32/psapi/collecting-memory-usage-information-for-a-process

To get the process ID of the running program for example you can use GetCurrentProcessId()

Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40