From: Csaba Henk Date: 2005-03-19T06:54:52+09:00 Subject: Re: Maximum stack depth On 2005-03-18, Robert Klemme wrote: > > "vruz" schrieb im Newsbeitrag > news:6b809bd8050317072128a96c1f@mail.gmail.com... >> > Is it just me, or does a stack limited to less than 1000 levels of >> > recursion seem... crippled? >> >> 1891 levels in my old redhat linux 7.3 box, ruby 1.8.2 built from source > > Just to add another number: > > 09:49:43 [source]: ruby -e 'def t(i) p i;t(i+1) end;t 0' > ... > 13280 > 13281 > 13282 > 13283 > -e:1:in `p': stack level too deep (SystemStackError) > from -e:1:in `t' > from -e:1:in `t' In my ruby installations under gentoo, there is no "stack level too deep", ruby just eats up all memory and then the OS gracefully kills it (it happens when I don't link it against pthread). It seems that function data is stored on the heap. Is it possible? Under what circumstances can this phenomenon -- ie., that ruby doesn't runs out of stack upon a deep recursion -- occur (OS, kernel (OS, compilation options, compilation options, ...) ? Csaba