I know about GC.enable/disable
, but is there any way of controlling the Ruby 1.9 garbage collector in more detail?
When profiling my code (using perftools.rb) I notice that the GC stands for up to 30% of the total samples, and I'd like to see if it's possible to tune the GC to decrease this number. Are there any environment variables or other means by which you can set the number of heap slots, the malloc limit, etc. like you can with REE?
Yep, for short.
At first, basic constants, defining GC behavior (defaults value are shown) :
More details about GC, may help
A story from 37signals guys, which may definitively help you. They used manual GC calls (GC.start) on time, instead of memory size, and got huge boost.
No.
There is no way to tune the 1.9.0–1.9.2 GC. However, you can compile a custom VM that exposes more or less the same tuning parameters as REE with this patch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With