diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 0416b20176c0fc..188ef75fae1775 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -2771,12 +2771,14 @@ def test_warmup_frees_pages # Disable GC so we can make sure GC only runs in Process.warmup GC.disable - total_pages_before = GC.stat(:heap_eden_pages) + GC.stat(:heap_allocatable_pages) + total_pages_before = GC.stat_heap.map { |_, v| v[:heap_eden_pages] + v[:heap_allocatable_pages] } Process.warmup # Number of pages freed should cause equal increase in number of allocatable pages. - assert_equal(total_pages_before, GC.stat(:heap_eden_pages) + GC.stat(:heap_allocatable_pages)) + total_pages_before.each_with_index do |val, i| + assert_equal(val, GC.stat_heap(i, :heap_eden_pages) + GC.stat_heap(i, :heap_allocatable_pages), "size pool: #{i}") + end assert_equal(0, GC.stat(:heap_tomb_pages)) assert_operator(GC.stat(:total_freed_pages), :>, 0) end;