menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Mastering ...
source image

Medium

2w

read

169

img
dot

Mastering Garbage Collection in Java

  • Garbage Collection (GC) in Java is an automatic process that removes unused objects in the Heap memory space, eliminating the need for manual memory management.
  • In Java, objects are considered garbage when no part of the program can reach them, and GC works in three main phases: Mark Phase, Sweep Phase, and Compact Phase.
  • Memory in Java is divided into Generations like Young Gen and Old Gen, where objects initially go to Young Gen and then to Old Gen after surviving several GC cycles.
  • Various GC strategies like Serial, Parallel, CMS, G1, and ZGC offer different benefits such as low pause times, better throughput and low latency balance, and ultra-low latency, catering to different use cases and applications.

Read Full Article

like

10 Likes

For uninterrupted reading, download the app