This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Originally posted by ramanuja varun: Does the garbage collector use any algorithm? If yes please do mention that.
Wow. Yes. It uses tons of algorithms....
Overall, the Sun GC breaks the heap into two generations. Young, which is generally for newer short lived objects. And Tenure, which objects gets promoted to after this lived for awhile.
For the young generation, it supports two (or three) different GC algoritums -- which are all based on the copy garbage collector. For the old generation, it also supports three different GC -- which are based on the mark and sweep garbage collector. (although, I am not sure what algorithm the incremental gc is based on)
Then you have you RT JVMs, like BEA JRockit and IBM Metronome, which have GC that supports the realtime needs of the JVM.
Finally (and coolest of all), I work for a company that makes a hardware assisted JVM -- which has a GC that is pauseless.