views:

25

answers:

2

So, ruby enterprise documentation states that all the values in the GC settings are defined in slots: http://www.rubyenterpriseedition.com/documentation.html#_garbage_collector_performance_tuning

(e.g. RUBY_HEAP_MIN_SLOTS)

We fine-tuned our app's min slot size and increment for the best performance by trial and error (we have enough machines to get a good idea how different values affect the number of malloc calls and Full GCs).

But something has been bugging me for a while: How big is 1 slot in bytes?

A: 

The default in 1.9 is 8K

http://svn.ruby-lang.org/repos/ruby/trunk/gc.c (search for HEAP_SIZE)

Note well that whenever it runs out of space and needs to reallocate, in 1.9 it allocates exponentially more heaps.

In 1.8 it would allocate bigger and bigger heaps.

rogerdpack
The question is about the size of 1 slot (i.e. the default min heap size is 10_000 slots, how big is 1 slot)
glebm
A: 

After diggin' through the code:

1 slot is a size of sizeof(struct RVALUE), which depends on the machine.

glebm