Project

General

Profile

Feature #9924

Revisitting GC.stat keys

Added by Koichi Sasada over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
[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 trunk - Feature #9923: Revisitting GC.stat keys Closed 06/09/2014

Associated revisions

Revision 47471
Added by Koichi Sasada about 2 years ago

  • 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.

Revision 47471
Added by Koichi Sasada about 2 years ago

  • 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.

Revision 47471
Added by Koichi Sasada about 2 years ago

  • 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.

Revision 47488
Added by Koichi Sasada about 2 years ago

  • 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]

Revision 47488
Added by Koichi Sasada about 2 years ago

  • 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]

Revision 47488
Added by Koichi Sasada about 2 years ago

  • 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]

Revision 47490
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): support:
    • total_allocated_pages
    • total_freed_pages ref: [Feature #9924]

Revision 47490
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): support:
    • total_allocated_pages
    • total_freed_pages ref: [Feature #9924]

Revision 47490
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): support:
    • total_allocated_pages
    • total_freed_pages ref: [Feature #9924]

Revision 47491
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename:
    • remembered_shady_object -> remembered_wb_unprotected_objects
    • remembered_shady_object_limit -> remembered_wb_unprotected_objects_limit
    • old_object -> old_objects
    • old_object_limit -> old_objects_limit ref: [Feature #9924]

Revision 47491
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename:
    • remembered_shady_object -> remembered_wb_unprotected_objects
    • remembered_shady_object_limit -> remembered_wb_unprotected_objects_limit
    • old_object -> old_objects
    • old_object_limit -> old_objects_limit ref: [Feature #9924]

Revision 47491
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename:
    • remembered_shady_object -> remembered_wb_unprotected_objects
    • remembered_shady_object_limit -> remembered_wb_unprotected_objects_limit
    • old_object -> old_objects
    • old_object_limit -> old_objects_limit ref: [Feature #9924]

Revision 47493
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename heap_used' toheap_allocated_pages'. ref: [Feature #9924]
  • test/ruby/test_gc.rb: add constraints test for gc stat information.

Revision 47493
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename heap_used' toheap_allocated_pages'. ref: [Feature #9924]
  • test/ruby/test_gc.rb: add constraints test for gc stat information.

Revision 47493
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename heap_used' toheap_allocated_pages'. ref: [Feature #9924]
  • test/ruby/test_gc.rb: add constraints test for gc stat information.

Revision 47495
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename:
    • malloc_increase -> malloc_increase_bytes
    • malloc_limit -> malloc_increase_bytes_limit
    • oldmalloc_increase -> oldmalloc_increase_bytes
    • oldmalloc_limit -> oldmalloc_increase_bytes_limit ref: [Feature #9924]

Revision 47495
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename:
    • malloc_increase -> malloc_increase_bytes
    • malloc_limit -> malloc_increase_bytes_limit
    • oldmalloc_increase -> oldmalloc_increase_bytes
    • oldmalloc_limit -> oldmalloc_increase_bytes_limit ref: [Feature #9924]

Revision 47495
Added by Koichi Sasada about 2 years ago

  • gc.c (gc_stat_internal): rename:
    • malloc_increase -> malloc_increase_bytes
    • malloc_limit -> malloc_increase_bytes_limit
    • oldmalloc_increase -> oldmalloc_increase_bytes
    • oldmalloc_limit -> oldmalloc_increase_bytes_limit ref: [Feature #9924]

Revision 48423
Added by Koichi Sasada almost 2 years ago

  • 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.

Revision 48423
Added by Koichi Sasada almost 2 years ago

  • 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.

Revision 48423
Added by Koichi Sasada almost 2 years ago

  • 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.

History

#1 [ruby-core:63022] Updated by Koichi Sasada over 2 years ago

#2 [ruby-core:63767] Updated by Koichi Sasada about 2 years ago

No objection?

#3 [ruby-core:64043] Updated by Koichi Sasada about 2 years ago

I got Matz's approval.

#4 [ruby-core:64891] Updated by Koichi Sasada about 2 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.

#5 [ruby-core:64897] Updated by Koichi Sasada about 2 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?

#6 [ruby-core:64909] Updated by Koichi Sasada about 2 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]

#8 [ruby-core:66279] Updated by Koichi Sasada almost 2 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