针对特定情况的垃圾收集
我正在研究垃圾收集的基础知识以及每种算法的不同算法(加上优点和缺点等......)。我正在尝试确定用于不同场景的最佳垃圾收集算法。
例如:堆上的所有东西都大小相同,所有东西都小,寿命短,所有东西大,寿命更长。
-如果所有内容的大小相同,则堆碎片不是问题。而且我不必担心压缩问题。那么也许引用计数?
-小物体寿命短?
-大物体具有更长的使用寿命? (可能是因为寿命的缘故)
我正在看:引用计数、Mark &扫描、停止和复制和世代
I'm working with just the basics of garbage collection and the different algorithms of each (plus pro's con's etc..). I'm trying to determine that best garbage collection algorithm to use for different scenarios.
such as: everything on heap same size, everything small w/ short lifespan, everything large w/ longer lifespan.
-if the everything is the same size heap fragmentation isn't an issue. Also I wouldn't have to worry about compaction. So maybe reference counting?
-small obj w/ short lifespan?
-large obj w/ longer lifespan? (possibly generational because of lifespan)
I'm looking at: Reference counting, Mark & Sweep, Stop & Copy and Generational
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Paul Wilson 的论文“单处理器垃圾收集技术”是对垃圾收集算法的非常方便的调查。虽然已有几年历史,但他所涵盖的大部分内容在今天仍然具有现实意义。并且,他还包含有关性能的信息等等。请记住,CPU 指令并不像 20 年前那么昂贵。 ;)
http://www.cse.nd。 edu/~dthain/courses/cse40243/spring2006/gc-survey.pdf
Paul Wilson's paper, "Uniprocessor Garbage Collection Techniques" is a very handy survey of garbage collection algorithms. It's a few years old, but most of what he covers is still relevant today. And, he includes information on performance, and so on. Just remember that CPU instructions aren't as expensive as they were 20 years ago. ;)
http://www.cse.nd.edu/~dthain/courses/cse40243/spring2006/gc-survey.pdf