Why stack overflow?

Ok so my understanding of how executable files are executed in memory is a square box representing the memory available to your application.

The program code is located at the bottom of the memory, the stack is distributed over the spot located behind the program code, and is distributed up. the heap starts at the top of the memory and is distributed down.

If so, why can more memory be allocated than a memory stack?

+3
source share
1 answer

Since even in modern systems with a large amount of virtual memory, the maximum size of the call stack is usually deliberately limited, say, 1 MB.

; ( setrlimit() Linux, -Xss Java). ; , .

+3

All Articles