What is default garbage collector for Java 7, 8 and 9




Contents of page :
  • 1) What is default garbage collector for Java 9?
  • 2) What is default garbage collector for Java 8 ?
  • 3) What is default garbage collector for Java 7 ?

1) What is default garbage collector for Java 9?
G1 garbage collector is going to be the default garbage collector in jdk 9.

2) What is default garbage collector for Java 8 ?
For server class machine (with at least 2 processors and at least 2 GB of physical memory) - The default garbage collector is the parallel collector.
For your information : These days most of the machines do have at least 2 processors so, on most of machines default garbage collector is the parallel collector.

For client class machine( single processor or 32-bit platform machine), The default garbage collector is the serial collector.

Note :  Many people believe G1 is the default but it is not default garbage collector in jdk 8.
It can be enabled by using vm para -XX:+UseG1GC


3) What is default garbage collector for Java 7 ?
For server class machine (with at least 2 processors and at least 2 GB of physical memory) - The default garbage collector is the parallel collector.
For client class machine( single processor or 32-bit platform machine), The default garbage collector is the serial collector.

Note :  G1 was introduced in java 7 but it is not garbage collector in jdk 7.




SUMMARY>
So in this core java tutorial we learned what are default garbage collector in different versions of Java like in 7, 8 and 9.

1) What is default garbage collector for Java 9?

2) What is default garbage collector for Java 8 ?
For server class machine - parallel collector.
For client class machine - serial collector.

3) What is default garbage collector for Java 7 ?
For server class machine - parallel collector.
For client class machine - serial collector.


Having any doubt? or you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.


RELATED LINKS>


 

Different type of garbage collectors in java>

>Serial collector / Serial GC (Garbage collector) in java

>Throughput GC (Garbage collector) or Parallel collector in java

>Concurrent Mark Sweep (CMS) collector / concurrent low pause garbage collector in java

>G1 garbage collector / Garbage first collector in java


JVM in detail - Garbage collection & heap structure >

>JVM Heap memory (Hotspot heap structure) with diagram in java


>What are Minor, Major and Full garbage collection in JVM in java



Important VM parameters >

>Most important and frequently used VM (JVM) PARAMETERS with examples in JVM Heap memory in java


Monitor, analyze garbage collection and fix MEMORY LEAK >

>How to monitor and analyze the garbage collection in 10 ways in java

>Detecting and fixing memory leak in java


eEdit
Must read for you :