Aegis professionals are sharing this first post about Garbage Collection (GC) with Java community and developers across the world to let them understand about the basics of GC in Java.
Your JVM (Java Virtual Machine) handles memory for your projects and it seems highly achievable with convenience, but this is not tuned by default. You need to understand some basic theory parts of the Garbage Collection to tune the collector more easily. The main concern is for efficiency of collector, i.e. how much time the program will take for program code execution instead of collecting garbage. Another point to note down is how long the application will remain on the pause mode.
You may find many opinions about garbage collection and you need to understand the algorithms in depth to escape from any trapping situation.
It is a process of looking at heap memory, recognizing the in-use and eliminating the unused objects. Here, in-use object refers to some part of your program that still maintains a pointer to that object. Hence, the memory spaced by unused objects can be reclaimed.
The programming language like C uses manual process to allocate or deallocate the memory, whereas in Java, Garbage Collector will automatically handles the deallocating memory process.
Here, this term is used to indicate that every thread of your program (or mutator in GC speak) is paused or stopped until the operation gets completed. Garbage Collection is used to ‘Stop the World’ events.
Java virtual machine has sorts of garbage collectors and each collector has its own features and characteristics to perform different operations. Some key collectors are:
We hope all the above information will help you to understand about Garbage collections.
For further information, mail us at firstname.lastname@example.org