Gambit-C的GC机制是什么?
Gambit-C的GC机制是怎样的?我对制作交互式应用程序感到好奇。我想知道是否可以避免突发GC操作。
What's the Gambit-C's GC mechanism? I'm curious about this for making interactive app. I want to know whether it can avoid burst GC operation or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据这些线程:
Gambit 至少在 2008 年 9 月之前具有传统的 stop-the-world GC。线程中的人们建议使用预分配的对象池来避免 GC 操作本身。我无法了解当前的实施情况。
*很难同意谈话内容。因为我无法池化不是我自己编写的对象,最终,由于积累的小/非池化临时对象,有时会发生full GC。但@Gregory提到的方法可能有助于避免这个问题。不过,我希望增量 GC 添加到 Gambit 中:)
According to these threads:
Gambit has traditional stop-the-world GC at least until September 2008. People in thread recommended using pre-allocated object pooling to avoid GC operation itself. I couldn't find out about current implementation.
*It's hard to agree with the conversation. Because I can't pool object not written by myself and finally full-GC will happen at sometime by accumulated small/non-pooled temporary objects. But the method mentioned by @Gregory may help to avoid this problem. However, I wish incremental GC added to Gambit :)
根据 http://dynamo.iro.umontreal.ca/ ~gambit/wiki/index.php/Debugging#Garbage_collection_threshold gambit 有一些控制:
如果您在少量操作后强制进行垃圾回收,或者将其安排为接近连续,或者将 livepercent 设置为 90 之类,那么 gc 可能会频繁运行,并且每次运行时不会执行太多操作。总体而言,这可能会更昂贵,但可以避免费用激增。然后,您可以相当轻松地预算该费用,以使服务速度更快。
According to http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Debugging#Garbage_collection_threshold gambit has some controls:
If you force garbage collection after some small number of operations, or schedule it near continuously, or set the livepercent to like 90 then presumably the gc will run frequently and not do very much on each run. This is likely to be more expensive overall, but avoid bursts of expense. You can then fairly easily budget for that expense to make the service fast despite.