JVM garbage collection algorithm

jvm

Solution

First off, there is more than one version of the JVM.

I believe most major JVM's are using a generational garbage collection by default. They may also use a hybrid strategy however.

Here are some links on major JVM's using generational garbage collection:

- OJVM Generational collection

- Hotspot JVM

Here is a great article I found that indicates Jrockit uses a marking strategy: Comparison of three Major JVM's

Problem

I know there are different garbage collection algorithms. Those are Copy collection and Mark Compact collection, Incremental collection. I have a query now. Which algorithm is used in JVM? Why there are different algorithm available?

Original source