How to know %d part?
The %d
part is the sizes returned from GC.stat_heap
. On 64-bit systems, it's 40, 80, 160, 320, 640. On 32-bit systems it's 20, 40, 80, 160, 320.
How to tune the value?
You use RUBY_GC_HEAP_INIT_SIZE_40_SLOTS=4000000
to have 4M slots in the 40 byte size pool, for example.
it seems difficult to set it compare with setting 1 init value.
Yes, it is more difficult than setting one value, but users of this API should be aware of how the GC internals work if they want to use this.
Another idea is to introduce RUBY_GC_HEAP_INIT_PAGES for the global page pool.
The idea of RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS
is to set initial sizes for Rails apps so the GC doesn't need to warm up. RUBY_GC_HEAP_INIT_PAGES
will allocate pages to size pools based on the distribution of objects at boot, and I worry that it will be a different distribution than serving requests.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3