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:
parent
605421f4eb
commit
4453280bb4
Notes:
git
2021-08-02 10:18:59 +09:00
1 changed files with 3 additions and 2 deletions
|
@ -69,10 +69,11 @@ class TestGCCompact < Test::Unit::TestCase
|
||||||
}
|
}
|
||||||
count = GC.stat :compact_count
|
count = GC.stat :compact_count
|
||||||
GC.auto_compact = true
|
GC.auto_compact = true
|
||||||
loop do
|
n = 1_000_000
|
||||||
|
n.times do
|
||||||
break if count < GC.stat(:compact_count)
|
break if count < GC.stat(:compact_count)
|
||||||
list2 << Object.new
|
list2 << Object.new
|
||||||
end
|
end and skip "implicit compaction didn't happen within #{n} objects"
|
||||||
compact_stats = GC.latest_compact_info
|
compact_stats = GC.latest_compact_info
|
||||||
refute_predicate compact_stats[:considered], :empty?
|
refute_predicate compact_stats[:considered], :empty?
|
||||||
refute_predicate compact_stats[:moved], :empty?
|
refute_predicate compact_stats[:moved], :empty?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue