Project

General

Profile

Feature #9924

Revisitting GC.stat keys

Added by ko1 (Koichi Sasada) almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:63021]

Description

Now, GC.stat returns internal information abuot GC.

However, key names are from internal implementations fields,
so that it is difficult to understand what they mean.

To solve this problem, I reconsider about key names.
https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing

Any comments are welcome.


Related issues

Copied from Ruby master - Feature #9923: Revisitting GC.stat keysClosedko1 (Koichi Sasada)06/09/2014Actions

Updated by ko1 (Koichi Sasada) almost 6 years ago

Updated by ko1 (Koichi Sasada) almost 6 years ago

I got Matz's approval.

Updated by ko1 (Koichi Sasada) over 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r47471.


  • gc.c (rb_objspace_t::heap_pages): rename field names:
    • used -> allocated_pages
    • increment -> allocatable_pages
    • length -> sorted_length And remove unused `limt' field.
  • gc.c: rename macros:
    • heap_pages_used -> heap_allocated_pages
    • heap_pages_length -> heap_pages_sorted_length
    • heap_pages_increment -> heap_allocatable_pages
  • gc.c (gc_stat_internal): fix symbol names ref: [Feature #9924] https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing Yellow color fields in this table are changed.
  • test/ruby/test_gc.rb: catch up this change.

Updated by ko1 (Koichi Sasada) over 5 years ago

  • Status changed from Closed to Open

r47472
r47473
r47474

are also related changes (and not finished).

These fixes break prorgrams depends on specific GC.stat() keys.

Any other objections?

Updated by ko1 (Koichi Sasada) over 5 years ago

  • Status changed from Open to Closed

Applied in changeset r47488.


  • gc.c (objspace_total_slot): rename objspace_available_slots.
  • gc.c (objspace_live_slot, objspace_free_slot): rename ..._slot() to ..._slots().
  • gc.c (objspace_free_slot): should subtract heap_pages_final_slots.
  • gc.c (gc_stat_internal):
    • add `heap_available_slots' field
    • rename heap_live_slot to heap_live_slots
    • rename heap_free_slot to heap_free_slots ref: [Feature #9924]

Updated by ko1 (Koichi Sasada) over 5 years ago

  • Status changed from Open to Closed

Applied in changeset r48423.


  • gc.c (gc_stat_internal): add compatible layer. From Ruby 2.2, keys of GC.stat are changed [Feature #9924]. To provide compatible layer, GC.stat add a default_proc (if default_proc of given Hash object is not set). At first use of this compatible layer of interpreter process, show a warning message like that: program: GC.stat[:total_allocated_object] warning message: "warning: GC.stat keys were changed from Ruby 2.1. In this case, you refer to obsolete total_allocated_object' (new key istotal_allocated_objects'). Please check https://bugs.ruby-lang.org/issues/9924 for more information." Pleaes correct my English message :)
  • hash.c (rb_hash_set_default_proc): export (in internal).
  • internal.h: ditto.

Also available in: Atom PDF