1

I'm using Visual Studio 2013 on Windows 7 - 64 bit machine.
I'm writing a program on C.
How can I check how much heap and stack storage my program is using?

chux - Reinstate Monica
  • 143,097
  • 13
  • 135
  • 256
Michael Vaysman
  • 277
  • 3
  • 16

1 Answers1

3

Heap consumption , internally & externally ( programatically ) : You can use GetProcessMemory function : https://msdn.microsoft.com/en-us/library/ms683219.aspx

Heap consumption , externally & non programatically : You can use MS Technet`s VMMap : https://technet.microsoft.com/en-us/sysinternals/vmmap.aspx

Stack consumption , internally ( programatically ) : You can use Windows thread information block : https://stackoverflow.com/a/1747249/1996740

Stack consumption , externally & programatically : Here is a nice answer showing how you can access an external thread`s thread information block : https://stackoverflow.com/a/8751576/1996740

Community
  • 1
  • 1
Akin Ocal
  • 471
  • 4
  • 11