Issue #21964 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.3: REQUIRED, 3.4: REQUIRED, 4.0: DONE to 3.3: REQUIRED, 3.4: WONTFIX, 4.0: DONE This is rather a performance issue. I won't backport. ---------------------------------------- Bug #21964: Fiber stack acquire can expand unnecessarily https://bugs.ruby-lang.org/issues/21964#change-117633 * Author: ioquatix (Samuel Williams) * Status: Closed * Assignee: ioquatix (Samuel Williams) * Backport: 3.3: REQUIRED, 3.4: WONTFIX, 4.0: DONE ---------------------------------------- In several common scenarios, the fiber stack allocator can choose to expand the fiber stack pool even when there are unreachable (effectively dead) fibers. For example, the following program will eventually crash if GC does not run in time: ```ruby loop do Fiber.new{Fiber.yield}.resume end ``` We have a loop that resumes a fiber, that fiber yields, and then becomes unreachable. Eventually, we will exhaust the OS vm map limit and fail with `FiberError`. However, at most only one fiber (stack) is needed to execute the above program, since the fiber immediately becomes unreachable. To fix this, we need to run GC on expansion failure: <https://github.com/ruby/ruby/pull/16535>. -- https://bugs.ruby-lang.org/