1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Stop infinite object allocation to get rid of OOM killer

This commit is contained in:
Nobuyoshi Nakada 2021-08-02 08:38:30 +09:00
parent 605421f4eb
commit 4453280bb4
Notes: git 2021-08-02 10:18:59 +09:00

View file

@ -69,10 +69,11 @@ class TestGCCompact < Test::Unit::TestCase
}
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?