# Comparing Java ZGC and G1 for Tail Latency in a Quarkus Microservice

DevFeed: [Comparing Java ZGC and G1 for Tail Latency in a Quarkus Microservice](<https://devfeed.tech/articles/let-s-take-a-look-at-lower-java-tail-latencies-with-zgc-18850.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/lower-java-tail-latencies-with-zgc/>)

Published: 2025-09-17T15:09:00Z

Content type: article

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Databases](<https://devfeed.tech/topics/databases.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [gc](<https://devfeed.tech/tags/gc.md>), [java](<https://devfeed.tech/tags/java.md>), [lts](<https://devfeed.tech/tags/lts.md>), [performance](<https://devfeed.tech/tags/performance.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>), [sample](<https://devfeed.tech/tags/sample.md>)

## AI overview

This article compares Java's ZGC and G1 garbage collectors using default settings in a sample Quarkus microservice that reads data from a Postgres database. The benchmark applies 1,000 requests per second and measures request latencies on a four-core, 4 GB RAM instance. The supplied excerpt does not include the comparison results.

## Source excerpt

Table of Contents ZGC Allocation Stalls Summary In the "Let's Take a Look at...!" blog series I am exploring interesting projects, developments and technologies in the data and streaming space. This can be KIPs and FLIPs, open-source projects, services, relevant improvements to Java and the JVM, and more. The idea is to get some hands-on experience, learn about potential use cases and applications, and understand the trade-offs involved. If you think there's a specific subject I should take a look at, let me know in the comments below. Java 25 was released earlier this week, and it is the first Java release with long-term support (LTS) which ships with Generational ZGC as the one (and only) flavor of the ZGC garbage collector. ZGC itself is a relatively new concurrent collector, originally added in Java 11.