OpenJDK Terminology

Garbage Collection

July 03, 2026

Garbage Collection (GC) is the process by which the JVM automatically reclaims memory occupied by objects that are no longer reachable by the running application. Java developers do not call free() or delete() as in C or C++; the garbage collector handles memory management automatically.

Most JVM garbage collectors divide the heap into generations. The assumption — the "generational hypothesis" — is that most objects die young. New objects are allocated in the young generation, which is collected frequently and cheaply. Objects that survive long enough are promoted to the old generation, which is collected less often but at greater cost.

GC involves a trade-off between throughput (how much work the application gets done per unit of time) and latency (how long GC pauses interrupt the application). Choosing the right garbage collector for your workload is one of the most impactful performance decisions you can make.

More reading on Foojay:

Comments (0)

Your email address will not be published. Required fields are marked *

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

Save my name, email, and website in this browser for the next time I comment.

Comments (0)

Highlight your code snippets using [code lang="language name"] shortcode. Just insert your code between opening and closing tag: [code lang="java"] code [/code]. Or specify another language.

No comments yet. Be the first.

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard