Memory leak in Concurrent::Promises.future
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- ruby
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
* 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.
- 主要言語
- Ruby
- スター
- 5.8k
- フォーク
- 420
- 平均マージ
- 20時間 45分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby-concurrency/concurrent-ruby のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
ruby-concurrency/concurrent-ruby#1118 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ruby-concurrency/concurrent-ruby#1099 · コメント 9 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ruby-concurrency/concurrent-ruby#1095 · コメント 8 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
ruby-concurrency/concurrent-ruby#1093 · コメント 3 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
ruby-concurrency/concurrent-ruby#1091 ·
ruby-concurrency/concurrent-ruby の issue をすべて見る
似ている issue
-
バグ
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
voxpupuli/puppet-epel#186 · コメント 1 件 ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) オープンBug Frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TheOdinProject/curriculum#31402 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100