Solved What is the Stack and Heap size of my Qt/C++ project?
-
@Mucip said in What is the Stack and Heap size of my Qt/C++ project?:
Where is windows.h?!
Should be part of the windows compiler. What are you using?
-
@VRonin said in What is the Stack and Heap size of my Qt/C++ project?:
Should be part of the windows compiler. What are you using?
Hi,
Win10 , QT Creator 4.7.0, QT 5.11.1 (MSVC 2015, 32 bit)Regards,
Mucip:) -
@Mucip
You're in a severe mess if your MSVC doesn't have/findwindows.h
! -
Working example compiled with MSVC: http://rextester.com/HCD11597
#include <iostream> #include <windows.h> #include <psapi.h> double getUsedMemoryMB() { PROCESS_MEMORY_COUNTERS pmc; GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)); return static_cast<double>(pmc.WorkingSetSize) / static_cast<double>(1024 * 1024); } int main() { std::cout << getUsedMemoryMB(); }
-
@JonB said in What is the Stack and Heap size of my Qt/C++ project?:
You're in a severe mess if your MSVC doesn't have/find windows.h!
Hi,
I guess so...
Shoul I install win 10 SDK???Regards,
Mucip:) -
@JonB said in What is the Stack and Heap size of my Qt/C++ project?:
You're in a severe mess if your MSVC doesn't have/find windows.h!
Hi,
My situaiton like below...Regards,
Mucip:) -
@VRonin said in What is the Stack and Heap size of my Qt/C++ project?:
#include <psapi.h>
Hi,
Finally I got it... Calital letter problem. It must be:#include "Windows.h"
#include "Psapi.h"Is returning number STACK or HEAP?... And what is the limit?...
Regards,
Mucip:) -
@Mucip Windows filing system is case-insensitive, so no idea why you say you require capitals.
-
@Mucip said in What is the Stack and Heap size of my Qt/C++ project?:
Is returning number STACK or HEAP?
It's the sum of both
And what is the limit?
for 64bit systems the limit is just the hardware (how much RAM you have) for 32bit systems is the lower of the hardware memory and 4GB
-
Dear @VRonin
Well, what about the 64K STACK limit I remember from old times?...Regards,
Mucip:)