垃圾收集器在Ruby 1.9中进行调整 [英] Garbage collector tuning in Ruby 1.9

查看:77
本文介绍了垃圾收集器在Ruby 1.9中进行调整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 GC.enable / disable ,但是有什么方法可以更详细地控制Ruby 1.9 垃圾回收器吗?



在分析我的代码时(使用perftools.rb),我注意到GC占总样本数的30%,我想看看它是否可能调整GC来减少这个数字。是否有任何环境变量或其他方法可以用来设置堆槽的数量,malloc限制等等,就像你可以用REE一样?

解决方案

不。



无法调整1.9.0-1.9.2 GC。但是,您可以编译自定义虚拟机,使用此修补程序或多或少地显示与REE相同的调整参数。

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?

解决方案

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.

这篇关于垃圾收集器在Ruby 1.9中进行调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆