Memory leak in Concurrent::Promises.future
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ruby
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Start at Concurrent::Promises.future and reproduce the report with the supplied Ruby script and concurrent-ruby 1.1.10. Trace retained objects around each future and wait call; done means the reported memory retention is resolved without changing the non-leaking return-value behavior noted in the issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
* Operating system: linux
* Ruby implementation: Ruby
* `concurrent-ruby` version: 1.1.10
* `concurrent-ruby-ext` installed: no
* `concurrent-ruby-edge` used: no
The test script
# frozen_string_literal: true
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'concurrent-ruby', '1.1.10'
gem 'memory_profiler', '~> 1'
end
class Thing; end
def report(title, &block)
puts title
pp MemoryProfiler.report(&block).retained_memory_by_class
end
report('Warmup') do
Concurrent::Promises.future { Thing.new }.wait
end
report('When waiting for the Future') do
Concurrent::Promises.future { Thing.new }.wait
end
report('When waiting for the Future with args') do
Concurrent::Promises.future(Thing.new) { |o| o }.wait
end
report('When waiting for the Future and actively dereferencing it') do
x = Concurrent::Promises.future { Thing.new }.wait
x = nil
end
report('When waiting for the Future with args and actively dereferencing it') do
x = Concurrent::Promises.future(Thing.new) { |o| o }.wait
x = nil
end
yields the following output
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using bundler 2.3.19
Using memory_profiler 1.0.0
Using concurrent-ruby 1.1.10
Warmup
[{:data=>"Thread", :count=>1048992},
{:data=>"Concurrent::CachedThreadPool", :count=>216},
{:data=>"Thread::Mutex", :count=>216},
{:data=>"Array", :count=>200},
{:data=>"Thread::ConditionVariable", :count=>192},
{:data=>"Concurrent::Event", :count=>144},
{:data=>"Proc", :count=>80},
{:data=>"String", :count=>80},
{:data=>"Thread::Queue", :count=>76},
{:data=>"Concurrent::RubyThreadPoolExecutor::Worker", :count=>40}]
When waiting for the Future
[{:data=>"Array", :count=>40}]
When waiting for the Future with args
[{:data=>"Array", :count=>40}]
When waiting for the Future and actively dereferencing it
[{:data=>"Array", :count=>40}]
When waiting for the Future with args and actively dereferencing it
[{:data=>"Array", :count=>40}]
Note that in contrast to #959 the return value of the block is not leaking here.
- Ngôn ngữ chính
- Ruby
- Star
- 5.8k
- Fork
- 420
- Merge trung bình
- 20 giờ 45 phút
- Pull request đã merge (30 ngày)
- 4
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ruby-concurrency/concurrent-ruby
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
ruby-concurrency/concurrent-ruby#1118 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ruby-concurrency/concurrent-ruby#1099 · 9 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
ruby-concurrency/concurrent-ruby#1095 · 8 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ruby-concurrency/concurrent-ruby#1093 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
ruby-concurrency/concurrent-ruby#1091 ·
Tất cả issue của ruby-concurrency/concurrent-ruby
Issue tương tự
-
バグ
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Version bump for OpenVox 9 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
voxpupuli/puppet-epel#186 · 1 bình luận ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) Đang mởBug Frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
TheOdinProject/curriculum#31402 · 1 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100