[前][次][番号順一覧][スレッド一覧]

ruby-changes:67018

From: Nobuyoshi <ko1@a...>
Date: Mon, 2 Aug 2021 10:18:42 +0900 (JST)
Subject: [ruby-changes:67018] 4453280bb4 (master): Stop infinite object allocation to get rid of OOM killer

https://git.ruby-lang.org/ruby.git/commit/?id=4453280bb4

From 4453280bb4aee7975d8e93e3d6bc8bfe8d75775f Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 2 Aug 2021 08:38:30 +0900
Subject: Stop infinite object allocation to get rid of OOM killer

---
 test/ruby/test_gc_compact.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb
index 7d8bde0..46683d0 100644
--- a/test/ruby/test_gc_compact.rb
+++ b/test/ruby/test_gc_compact.rb
@@ -69,10 +69,11 @@ class TestGCCompact < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc_compact.rb#L69
       }
       count = GC.stat :compact_count
       GC.auto_compact = true
-      loop do
+      n = 1_000_000
+      n.times do
         break if count < GC.stat(:compact_count)
         list2 << Object.new
-      end
+      end and skip "implicit compaction didn't happen within #{n} objects"
       compact_stats = GC.latest_compact_info
       refute_predicate compact_stats[:considered], :empty?
       refute_predicate compact_stats[:moved], :empty?
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]