6

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?

0

3 Answers 3

3

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:

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

Sign up to request clarification or add additional context in comments.

2 Comments

Also, JVMs offer a choice of garbage collection algorithms.
yes, but some JVM's have been tuned to use a specific strategy, for instance Jrockit.
3

Different garbage collectors have different strengths and weaknesses, important features are throughput, pause times and parallelization. Which garbage collectors are used or available depends on the JDK version, the JVM mode (client or server) and a ton of configuration settings you can use. Keep in mind that GC technology evolves. Here are some useful links:

Comments

0

as jvm develops, more and more jvm algorithms appear to solve the lack of pre-one, now in JDK5.0 there area four types clollector:serial ,throught,concurrent and train collector

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.