Forum Discussion
Altera_Forum
Honored Contributor
14 years agoRequired stack size mainly depends from the level of function nesting and size of local variables. You can reduce stack size if you inline functions and declare as static any big local variable (i.e. struct or array)
Determining the correct stack size is not straightforward because you must account for the worst case condition, which could be not easy to achieve. For SSS like projects I've never used stack sizes below 4096. I fear 1024 is a rather small value, unless your Simple Socket Server is really simple. A method for monitoring stack utilization I sometimes used is initializing stack with a known data pattern, run the application for a while and then peek into the stack area in order to see the maximum usage.