Understanding Garbage Collector in Java Part#2

       

   In this blog we will continue about GC and it's types


Types of Garbage Collections:














  • Serial collector: it runs in single Parts.
  • Concurrent Collector: it runs as the application run, and it doesn't wait for old generation memory to be full.



  • A parallel Collector: it starts to run when the heap is full, is consume multiple of you CPU to 















    perform.





When to use:

















Concurrent Collector:
  • there is more Memory.
  • high Numbers of CPU’s.
  • Application Demands short pauses.

Parallel Collector:
  • less Memory.
  • less numbers of CPU’s.
  • the application demands high through put, and can withstand pauses.

Types of operations:
  • MARK: go to root Node and marks all the objects are reachable and mark it as live.
  • Mark & Sweep: mark the unreachable objects and deletes it.
  • Compacting; compact memory by moving around the objects to free the memory.



Comments

Popular posts from this blog

Privacy Policy