[ruby-cvs:61615] ko1:r54453 (trunk): * gc.c: change additional allocation policy.

ko1 at ruby-lang.org ko1 at ruby-lang.org
Thu Mar 31 18:16:48 JST 2016

ko1	2016-03-31 18:16:48 +0900 (Thu, 31 Mar 2016)

  New Revision: 54453


    * gc.c: change additional allocation policy.
      Introduce new environement variable
      GC_HEAP_FREE_SLOTS_GOAL_RATIO (goal_ratio) to calculate the ratio
      of additional memory.
      Before this change, we add pages with the following formula
      (when free_slots < total_pages * RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO):
        next_pages = total_pages * RUBY_GC_HEAP_GROWTH_FACTOR
      This addition can allocate too much.
      With this change, we increase pages to satisfy the following formula:
        next_free_slots = next_total_slots * goal_ratio
        next_free_slots = free_slots + adding_slots
        next_total_slots = total_slots + adding_slots.
      If you want to prepare many free slots, increase this ratio.
      If this variable is 0, then simply multiply
    * gc.c (get_envparam_double): enable to accept 0.

  Modified files:

More information about the ruby-cvs mailing list