garbage collection for specific circumstances

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


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

链接地址: http://www.djcxy.com/p/27158.html

上一篇: C ++有垃圾收集类吗?

下一篇: 垃圾收集的具体情况