diff options
author | Peter Zhu <[email protected]> | 2023-08-14 11:24:50 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-08-15 15:18:05 -0400 |
commit | 0f94e653597dc2ae21ae39ac4c85266f3bb36ab6 (patch) | |
tree | 2adacaf075c1570a43d5150c32c206a5abd27a3a /gc.c | |
parent | 8c5b9ebf7144af73cf52209b73b849c078133dff (diff) |
Add stat force_incremental_marking_finish_count
This commit adds key force_incremental_marking_finish_count to
GC.stat_heap. This statistic returns the number of times the size pool
has forced incremental marking to finish due to running out of slots.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -707,6 +707,7 @@ typedef struct rb_size_pool_struct { size_t total_allocated_pages; size_t total_freed_pages; size_t force_major_gc_count; + size_t force_incremental_marking_finish_count; /* Sweeping statistics */ size_t freed_slots; @@ -8504,6 +8505,7 @@ gc_marks_continue(rb_objspace_t *objspace, rb_size_pool_t *size_pool, rb_heap_t else { gc_report(2, objspace, "gc_marks_continue: no more pooled pages (stack depth: %"PRIdSIZE").\n", mark_stack_size(&objspace->mark_stack)); + size_pool->force_incremental_marking_finish_count++; gc_marks_rest(objspace); } @@ -11182,6 +11184,7 @@ enum gc_stat_heap_sym { gc_stat_heap_sym_total_allocated_pages, gc_stat_heap_sym_total_freed_pages, gc_stat_heap_sym_force_major_gc_count, + gc_stat_heap_sym_force_incremental_marking_finish_count, gc_stat_heap_sym_last }; @@ -11201,6 +11204,7 @@ setup_gc_stat_heap_symbols(void) S(total_allocated_pages); S(total_freed_pages); S(force_major_gc_count); + S(force_incremental_marking_finish_count); #undef S } } @@ -11244,6 +11248,7 @@ gc_stat_heap_internal(int size_pool_idx, VALUE hash_or_sym) SET(total_allocated_pages, size_pool->total_allocated_pages); SET(total_freed_pages, size_pool->total_freed_pages); SET(force_major_gc_count, size_pool->force_major_gc_count); + SET(force_incremental_marking_finish_count, size_pool->force_incremental_marking_finish_count); #undef SET if (!NIL_P(key)) { /* matched key should return above */ |