From 01f74b28521069e2582fbd751c34b115fe033a2b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 14 Aug 2023 14:06:03 -0400 Subject: [PATCH] [DOC] Improve docs about keys in GC.stat_heap --- gc.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gc.rb b/gc.rb index 215a95b032..5f9940b4d6 100644 --- a/gc.rb +++ b/gc.rb @@ -219,6 +219,33 @@ module GC # If the optional argument, hash, is given, it is overwritten and returned. # # This method is only expected to work on CRuby. + # + # The hash includes the following keys about the internal information in + # the \GC: + # + # [slot_size] + # The slot size of the heap in bytes. + # [heap_allocatable_pages] + # The number of pages that can be allocated without triggering a new + # garbage collection cycle. + # [heap_eden_pages] + # The number of pages in the eden heap. + # [heap_eden_slots] + # The total number of slots in all of the pages in the eden heap. + # [heap_tomb_pages] + # The number of pages in the tomb heap. The tomb heap only contains pages + # that do not have any live objects. + # [heap_tomb_slots] + # The total number of slots in all of the pages in the tomb heap. + # [total_allocated_pages] + # The total number of pages that have been allocated in the heap. + # [total_freed_pages] + # The total number of pages that have been freed and released back to the + # system in the heap. + # [force_major_gc_count] + # The number of times major garbage collection cycles this size pool has + # forced to start due to running out of free slots. + # def self.stat_heap heap_name = nil, hash_or_key = nil Primitive.gc_stat_heap heap_name, hash_or_key end