We can change some of Ruby GC parameters with environment variables. Let’s see what’s available.
Initial number of object slots on the Ruby heap. Default value is 10000.
You might want to change this number if you know that your application will allocate lots of objects right from the start.
But on the other hand, we saw that Ruby is quite good at growing the heap space. It usually grows faster than we need. So there’s little need to change this parameter in practice.
Minimum number of free slots that must be free after GC. If this condition is not met, Ruby might grow the heap space. Default value is 4096.
As we discussed in GC Triggered by ...