What warning signs are there that my stack memory space is bloated, and at what point should I start using heap memory? And, are there differences between processors, I’m thinking about stack size limitations?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The size of the stack can be specified during linking. The exact method of doing so depends on your toolchain. Other than 32-bit versus 64-bit processors, I don’t know of any processor-based limitations on stack size.
As to if you are using too much, there’s no right or wrong answer to that, it is a design question and depends on your requirements. Since the stack size is set during linking, it will limit your maximum data more severely than using the heap, generally speaking at any rate. On the other hand, stack allocations and deallocations are faster than using the heap.