Add RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS to pre-init pools granularly

The old RUBY_GC_HEAP_INIT_SLOTS isn't really usable anymore as
it initalize all the pools by the same factor, but it's unlikely
that pools will need similar sizes.

In production our 40B pool is 5 to 6 times bigger than our 80B pool.
This commit is contained in:
Jean Boussier 2023-02-03 09:46:14 +01:00 committed by Jean Boussier
parent 6e7990144f
commit 3ab3455145
Notes: git 2023-02-08 08:26:29 +00:00
3 changed files with 41 additions and 5 deletions

View file

@ -550,7 +550,12 @@ There are currently 4 possible areas where the GC may be tuned by
the following 11 environment variables:
.Bl -hang -compact -width "RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR"
.It Ev RUBY_GC_HEAP_INIT_SLOTS
Initial allocation slots. Introduced in Ruby 2.1, default: 10000.
Initial allocation slots. Applies to all slot sizes. Introduced in Ruby 2.1, default: 10000.
.Pp
.It Ev RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS
Initial allocation of slots in a specific size pool.
The available size pools can be found in `GC.stat_heap`.
Introduced in Ruby 3.3.
.Pp
.It Ev RUBY_GC_HEAP_FREE_SLOTS
Prepare at least this amount of slots after GC.