Java Garbage collection

Java garbage collection is an automatic process to manage the runtime memory used by programs. By doing it automatic JVM relieves the programmer of the overhead of assigning and freeing up memory resources in a program.

Garbage collection works by employing several GC algorithm e.g. Mark and Sweep. There are different kinds of garbage collector available in Java to collect different area of heap memory e.g. you have serial, parallel and concurrent garbage collector in Java.

These tutorials are to understand the basics of Java garbage collection and how it works.

Related Tags

Tutorials

Memory regions marked - G1

Java Garbage Collection Algorithms [till Java 9]

In java garbage collection tutorial, we will learn about object life cycle, difference between mark-sweep, mark-sweep-compact and mark-copy mechanisms, different single threaded and concurrent GC algorithms (e.g. G1), and various flags to control the gc algorithm’s behavior and log useful information for applications.

Java Memory Model – Structure and Components

Whenever we execute a Java program, a separate memory area is reserved for storing various parts of our application code which we roughly call JVM memory. Though not necessary, having some knowledge about the structuring of this memory area is quite beneficial. Knowing Java memory model becomes more important when …

Java Memory Management – Garbage Collection Algorithms

We all are aware of the functional responsibilities of garbage collector [GC] in Java. But only few try to go real deep on how garbage collection works. You are not one of them and that’s why you are here. In this Java memory management tutorial, we will try to understand …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.