From: Brent Roman Date: 2009-03-02T17:41:03+09:00 Subject: [ruby-core:22619] Re: [Feature #1218] New method needed to set and get the current recursion limit setrlimit(RLIMIT_STACK, size_in_bytes) *should* do what you want under a POSIX compliant OS. See the manpage for setrlimit and getrlimit This could easily be made accessible to Ruby code via a 'C' extension. I have found that 1.8 Ruby is very inefficient in its use of stack-space and made some patches that improve this. With ulimit -s 8192, the attached little script on gives up after: 1.6.8-mbari8B: 14374 levels 1.8.6-p287: 7198 levels 1.8.7-p72: 7197 levels 1.8.7-p72-mbari8B: 14750 levels 1.8.6-p287-mbari8B: 14750 levels 1.9.0 : 7704 levels (but, see note below) Ruby 1.9 seems completely unaffected by stack size configured via setrlimit (via ulimit -s from the bash shell) Perhaps 1.9 is allocating the stack on the heap. If this is the case, you will need some support in the 1.9 core for changing the size of this allocation. - brent Usaku NAKAMURA wrote: > > Issue #1218 has been updated by Conrad Taylor. > > > Hi Dave, thanks for responding to the post. However, this does resolve > the issue that I'm seeing after increasing the stack size. There should > be some class methods for obtaining and setting the recursion limit. > > -Conrad > > > > > > > ---------------------------------------- > http://redmine.ruby-lang.org/issues/show/1218 > > ---------------------------------------- > http://redmine.ruby-lang.org > > > -- View this message in context: http://www.nabble.com/-ruby-core%3A22543---Feature--1218--New-method-needed-to-set-and-get-the-current-recursion-limit-tp22226204p22283425.html Sent from the ruby-core mailing list archive at Nabble.com.