Java Garbage collector strategies

All

Intro

I was reading recently about Gargabe collection in Java and I came to find Plumbr company their blogs about this theme. I came to this book [1]. The info I summarized below is basically from that source and others [2][3]. This is the first article about this topic and introduces the main concepts.

Garbage Collector – GC

Very well known, the garbage collector is the automated tool used for reclamation of unused memory eliminating. Such automation is called Garbage Collection. 

The so well debated Garbage Collector is one of those things that make Java such a special language actually.

Fragmenting and Compacting

If we eliminate the objects, considering that they are randomly distributed, the after fragmenting, it’s also an interesting thing to compact the memory. This process actually takes time and requires

Young and Tenured (Old)

The distribution of objects is done according to the time of creation/assignment time and by classifying those objects we pretty much get a complete and accurate picture about the objects, in a screenshot.

Stop The World pause

Basically is when the application is temporarily paused so the GC can do its complete work and clean the objects, but since they keep changing, we need to pause the application and take a screenshot of the application so the GC can delete real objects.

GC Algorithms

There are many algorithms that can be used in the GC that take different approaches for young and tenured objects, in other words, we can delete those objects using different ways.

REFs

[1]https://downloads.plumbr.io/Plumbr%20Handbook%20Java%20Garbage%20Collection.pdf

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s