Stack – Heap Memory Question - calculating and understanding.
-
Stack – Heap Memory Question I’m trying to figure out how one would determine the size of the stack. If my understanding is correct the stack is the reserved memory of an application for it’s statically declared objects and the heap is the memory reservoir of the computer. Can I get some feedback please, I've been finding the web and my texts a little short in this subject. Thx
-
Stack – Heap Memory Question I’m trying to figure out how one would determine the size of the stack. If my understanding is correct the stack is the reserved memory of an application for it’s statically declared objects and the heap is the memory reservoir of the computer. Can I get some feedback please, I've been finding the web and my texts a little short in this subject. Thx
By default, Win32 applications have a stack size of 1MB per thread. This can be changed on a per-thread basis by passing a value other than 0 in the dwStackSize argument to CreateThread/CreateRemoteThread or the default value used by all the threads in a process can be altered via the STACKSIZE element in your .def file. Once allocated, the stack is not resizable. The stack size and the reserved memory for the app have very little to do with each other.
-
By default, Win32 applications have a stack size of 1MB per thread. This can be changed on a per-thread basis by passing a value other than 0 in the dwStackSize argument to CreateThread/CreateRemoteThread or the default value used by all the threads in a process can be altered via the STACKSIZE element in your .def file. Once allocated, the stack is not resizable. The stack size and the reserved memory for the app have very little to do with each other.
First, thanks very much for the reply. I'll do some more searching with dwStackSize and STACKSIZE in the .def file. Is there any other wordings I could search on that might get me some more reference? I am also curious how other languages and non managed applications allocate. Thanks.