As per my understanding
- each thread of a process gets a stack, while there's typically only one heap for the process.
There is default stack max size limit set by OS.
- Windows-64 bit : 1MB
- Linux-64 bit : 8MB
Is this limit applicable at process level or each thread can have 1MB/8MB stack?
And what happens to the memory allotted to stack after thread exit?