Serial collector / Serial GC (Garbage collector) in java


In this core java tutorial we will learn about Serial GC (Garbage collector) in java.

Contents of page >
  • Serial collector / Serial GC (Garbage collector) in java
  • Features of Serial GC (Garbage collector) in java  >
  • When to Use the Serial GC (garbage Collector) in java >
  • Vm (JVM) option for enabling serial GC (garbage Collector) in java >
-XX:+UseSerialGC



Serial collector / Serial GC (Garbage collector) in java

Features of Serial GC (Garbage collector) in java  >
  • Serial collector is also called Serial GC (Garbage collector) in java.
  • Serial collector is simply also called Serial collector in java.

  • Serial GC (Garbage collector) is rarely used in java.
  • Serial GC (Garbage collector) is designed for the single threaded environments in java.
  • In Serial GC (Garbage collector) , both minor and major garbage collections are done serially by one thread (using a single virtual CPU) in java.
  • Serial GC uses a mark-compact collection method. This method moves older memory to the beginning of the heap so that new memory allocations are made into a single continuous chunk of memory at the end of the heap. This compacting of memory makes it faster to allocate new chunks of memory to the heap in java.
  • The serial garbage collector is the default for client style machines in Java SE 5 and 6.

When to Use the Serial GC (garbage Collector) in java >
  • The Serial GC is the garbage collector of choice for most applications that do not have low pause time requirements and run on client-style machines. It takes advantage of only a single virtual processor for garbage collection work in java.
  • Serial GC (garbage collector) is also popular in environments where a high number of JVMs are run on the same machine. In such environments when a JVM does a garbage collection it is better to use only one processor to minimize the interference on the remaining JVMs in java.

Vm (JVM) option for enabling serial GC (garbage Collector) in java >
-XX:+UseSerialGC
Example of Passing Serial GC in Command Line for starting jar>
java -Xms256m -Xms512m  -XX:+UseSerialGC -jar d:\MyJar.jar



Summary -
So in this core java tutorial we learned about Serial collector / Serial GC (Garbage collector) in java. We learned Features of Serial GC (Garbage collector) in java. Also When to Use the Serial GC (garbage Collector) in java. And Vm (JVM) option for enabling serial GC (garbage Collector) in java.



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>


No comments:

Post a Comment