https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112011-06-10T22:55:32ZRuby Issue Tracking SystemRuby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=176752011-06-10T22:55:32Zko1 (Koichi Sasada)
<ul><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li></ul><p>GC eats large stack size if there are nested object (deep nested array and so on). I'm not sure but I think this is why we allocate 512KB for stack.</p>
<p>Any comments?</p>
<p>I think that Thread.new should accept stack size.</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=177592011-06-11T16:23:15Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>Koichi Sasada <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>GC eats large stack size if there are nested object (deep nested array<br>
and so on). I'm not sure but I think this is why we allocate 512KB<br>
for stack.</p>
</blockquote>
<p>Good point. I didn't think of that (rare case for me). We would need a<br>
non-recursive implementation of gc_mark_children.</p>
<p>A simpler idea would be a dedicated marking thread with a deeper stack;<br>
but I think that's ugly.</p>
<blockquote>
<p>Any comments?</p>
<p>I think that Thread.new should accept stack size.</p>
</blockquote>
<p>I'm not sure what the API would be. While it would help me, I think it<br>
would be difficult to use and too low level for Ruby.</p>
<p>Meanwhile I can rebuild Ruby or use a trivial LD_PRELOAD:<br>
<a href="http://yhbt.net/libministack.c" class="external">http://yhbt.net/libministack.c</a></p>
<p>--<br>
Eric Wong</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=248832012-03-18T18:46:39Zshyouhei (Shyouhei Urabe)shyouhei@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=316612012-10-27T06:08:31Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li><li><strong>Priority</strong> changed from <i>3</i> to <i>5</i></li></ul><p>Ad-hoc solution, but environment variable (such as RUBY_THREAD_MACHINE_STACK_SIZE) is enough for this issue?</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=317462012-10-27T10:54:25Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>"ko1 (Koichi Sasada)" <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>Ad-hoc solution, but environment variable (such as<br>
RUBY_THREAD_MACHINE_STACK_SIZE) is enough for this issue?</p>
</blockquote>
<p>I think environment variable is too ugly, but it's your (or matz's)<br>
choice to support it.</p>
<p>Also, it seems the recursive structure problem with gc_mark_children()<br>
is gone since r37075.</p>
<p>Probably better to discuss <a class="issue tracker-2 status-2 priority-4 priority-default" title="Feature: Configuration for Thread/Fiber creation (Assigned)" href="https://bugs.ruby-lang.org/issues/6695">#6695</a> instead.</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=337002012-11-24T10:00:51Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>ko1, what's the status?</p>
<p>Too many 2.0.0 tickets, especially big task ones, are assigned to ko1. ko1, please decide your priorities.</p>
<p>Welcome to volunteer for helping him.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=339072012-11-26T09:20:52Zko1 (Koichi Sasada)
<ul></ul><p>Priority: <em>High</em>.</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=348702012-12-20T07:37:13Zko1 (Koichi Sasada)
<ul><li><strong>Priority</strong> changed from <i>5</i> to <i>Normal</i></li></ul><p>I add environment variable at r38479.</p>
<pre><code> - RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
default: 128KB (32bit CPU) or 256KB (64bit CPU).
- RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
creation. default: 512KB or 1024KB.
- RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
default: 64KB or 128KB.
- RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
creation. default: 256KB or 256KB.
</code></pre>
<p>I want to ask feedback about this default setting.</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=351212012-12-28T17:53:12Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>"ko1 (Koichi Sasada)" <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> wrote:</p>
<blockquote>
<p>I add environment variable at r38479.</p>
</blockquote>
<p>Thanks!</p>
<p>Btw, you put a giant "if false" around test/ruby/test_fiber.rb<br>
with that commit. Was that intentional?</p>
<blockquote>
<p>I want to ask feedback about this default setting.</p>
</blockquote>
<p>I'm fine with the current defaults (including the r38592 update)</p> Ruby master - Feature #4614: [RFC/PATCH] thread_pthread.c: lower RUBY_STACK_MIN_LIMIT to 64Khttps://bugs.ruby-lang.org/issues/4614?journal_id=362052013-02-13T16:00:59Zko1 (Koichi Sasada)
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul><p>Sorry I missed your comment.<br>
And the `if false' sentences may be removed.</p>