Suppose I am using a very heavy applications(or you can say that it is a very bad code which keeps on allocating memory on heap and won't free it and also uses recursion) Now after some point of time both heap and stack will have no space to expand.
Now In this situation heap and stack don't have any free space in between them and if I try to allocate some memory on heap then what will happen? will it overflow over stack?
And also what happens if we make a recursive call and stack needs to expand then will it overflow over heap?