Occasionally, while debugging applications, you will get an error message about a stack overflow. This message means that the application program used up all the stack space it was given when it was invoked. There are two causes for this error:
This sometimes occurs as a bug. If function a() calls function b() which calls function c() which calls function a() again, recursion may be happening unintentionally. If very deep recursion is being used, perhaps that algorithm can be changed so that less recursion is necessary. Often, the only solution is to increase the size of the stack.
If the application allocates large arrays as local variables, then the arrays could be allocated with the mem_get() function instead of being declared as locals.