[ruby-core:82196] Re: [Ruby trunk Bug#13772] Memory leak recycling stacks for threads in 2.4.1

From: Eric Wong <normalperson@...>
Date: 2017-07-27 09:19:55 UTC
List: ruby-core #82196
Thanks for the report, it seems it's the presence of
th->root_fiber in thread_start_func_2 and thread_free causing
stack to be unfreed.

Smaller reproduction w/o rest-client:

i = 0
100000.times.each_slice(32) do |slice|
  slice.map do
    Thread.new do
      f = Fiber.new {}
      f.resume
    end
  end.each(&:join)
  GC.start(full_mark: true, immediate_sweep: true)
  slots = GC.stat[:heap_live_slots]
  puts "slots #{slots} #{i+=1} threads #{Thread.list.count}"
end


Maybe ko1 can help fix it.

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next