Reputation: 287
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?
Upvotes: 1
Views: 166
Reputation: 491
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
Upvotes: 3