[lug] Huge stack size--any reason to avoid?

Ted Logan ted.logan at gmail.com
Thu Oct 19 07:40:10 MDT 2006


On 10/17/06, Vince Dean <vdean at ucar.edu> wrote:
> I'm working with some C++ code which puts very large
> data structures on the stack, large enough that we have
> to increase the allowable stack size to 512 megabytes:
>
>   ulimit -Ss 512000

Having such a large stack is certainly unorthodox, but there are
really only two factors that matter in the real world: Does it perform
as well as you'd like it to perform, and is it documented well enough
so future maintenance programmers will be able to figure out what's
going on? Profile first, then optimize -- that way, you don't waste
time optimizing something that doesn't need it, and you have hard
evidence that the three engineer-days spent optimizing were really
worth it.

-- 
Ted Logan
Software Engineer
ted.logan at gmail.com
http://jaeger.festing.org/



More information about the LUG mailing list