TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why You Should Be Excited About Garbage Collection in Ruby 2.0

106 点作者 DavidChouinard大约 13 年前

9 条评论

cpr大约 13 年前
Gosh, I hate to be that "old guy," but using bitmaps for mark &#38; sweep GC dates from the early 70's.<p>In particular, in GC implementations for Lisp and Lisp-like languages (such as the ECL implementation we used at Harvard in the mid-70's) where CONS cells were two eighteen-bit halfwords (CAR and CDR) fitting in a 36-bit word, there was no place for mark bits, so you'd use a bitmap instead (as rediscovered here).<p>And we used the same technique for finding the page headers (e.g., containing the mark bitmaps) for each part of the heap, aligning to a larger power of two so you could chop any pointer down by and'ing off the lower bits to get to the page header.<p>There really ain't much new under the sun. Too bad every generation has to rediscover all this stuff.
评论 #3749272 未加载
评论 #3750144 未加载
评论 #3749716 未加载
subwindow大约 13 年前
Not really excited. Sorry. To me this is an incremental improvement to a method of GC that is just not going to cut it.<p>Rubinius uses Generational GC. There are definitely some parts of Rubinius that are (currently) slower than MRI, but memory management stands to be one of places where Rubinius will demolish MRI in the long-run.<p>JRuby/JVM uses (from what I understand) a Generational-first hybrid GC. There's been so much work and analysis done on the JVM that there's no way in hell any mark and sweep GC is going to compete.<p>Honestly if MRI is going to remain competitive it needs to completely rethink the way it does GC.
评论 #3749115 未加载
jbellis大约 13 年前
Wake me up when they add compaction.<p><a href="http://en.wikipedia.org/wiki/Fragmentation_(computing)#Memory_fragmentation" rel="nofollow">http://en.wikipedia.org/wiki/Fragmentation_(computing)#Memor...</a><p>(CPython has this weakness too. <a href="http://www.slideshare.net/jbellis/pycon-2012-what-java-can-learn-from-python/8" rel="nofollow">http://www.slideshare.net/jbellis/pycon-2012-what-java-can-l...</a>)
pkulak大约 13 年前
I was expecting a lot more. It's still just mark and sweep, which is old news.
ajasmin大约 13 年前
How do other garbage collectors handle this?<p>Can I fork a Java or V8 process and take advantage of the copy-on-write optimization?
评论 #3748592 未加载
riffraff大约 13 年前
Narihiro Nakamura did a lot of hacking on the ruby GC ("longlife" used in twitter's Kiji, parallel marking, lazy sweeping, bitmap marking).<p>It's nice to see more of it ending up in the ruby mainline.
txttran大约 13 年前
it took 3+ years to develop this technique? it seemed like the most straightforward approach to the problem.
评论 #3749250 未加载
xenophanes大约 13 年前
So what's REE's solution and how does it differ from this approach?
评论 #3749168 未加载
verelo大约 13 年前
"Excited about Ruby" is something that I cant say I've ever been. Still...
评论 #3749491 未加载