标记和扫描GC有什么问题? [英] What's wrong with mark-and-sweep GCs?

查看:92
本文介绍了标记和扫描GC有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 Steve Yegge的Dynamic Languages Strike回来的谈话,并在其中他批评标记和扫描的GC(通过该链接约5-10%,猪试图飞幻灯片)他们有什么问题?

以下是引用的上下文: b
$ b


垃圾收集器是我得到的
最佳答案,因为
减少了暂停,坦白地说,
是今天所有
[new]动态语言的垃圾收集器是
废话。他们是马克和扫描,或
他们被引用计数。

从引用,他似乎在谈论相当原始的不是世代的GC。世代GC仍然可以被标记和扫描,但是它们大多数时间都没有标记,这使得它们比每次标记和扫描世界要快得多。

假设这就是他的意思,我同意 - 但他可以说得更清楚。请记住,这只是一场演讲,而不是博士论文,尽管表达自己的最明确的方式是棘手:)

I'm reading Steve Yegge's "Dynamic Languages Strike Back" talk, and in it he sort of criticizes mark-and-sweep GCs (about 5-10 percent through that link, the "Pigs attempt's to fly" slide) What's wrong with them?

解决方案

Here's the context of the quote:

Generational garbage collectors is the best answer I've got for that, because it reduces the pauses, and frankly, the garbage collectors for all the [new] dynamic languages today are crap. They're mark-and-sweep, or they're reference counted.

From the quote, he appears to be talking about fairly primitive GCs which aren't generational. Generational GCs can still be mark and sweep, but they have a lot less to mark most of the time, which makes them a lot faster than "mark and sweep the world every time".

Assuming that's what he meant, I agree - but he could have put it more clearly. Bear in mind that this was a talk rather than a doctoral thesis though - coming up with the clearest possible way of expressing yourself "on the hoof" is kinda tricky :)

这篇关于标记和扫描GC有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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