<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad" -->

---
title: Java 21's ZGC trades a little CPU for zero...
description: Switching from the G1 garbage collector to ZGC in Java 21 eliminates stop-the-world pauses that previously caused half-second IPC call timeouts and retries....
canonical: https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Java 21's ZGC trades a little CPU for zero stop-the-world pauses. No more IPC timeouts and retries. | daily.dev
og:description: Switching from the G1 garbage collector to ZGC in Java 21 eliminates stop-the-world pauses that previously caused half-second IPC call timeouts and retries....
og:url: https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad
og:image: https://api.daily.dev/og/posts/BBBYVxkAd.png
og:image:alt: Java 21's ZGC trades a little CPU for zero stop-the-world pauses. No more IPC timeouts and retries.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Java 21's ZGC trades a little CPU for zero stop-the-world pauses. No more IPC timeouts and retries.

**[Coffee \+ Software](https://daily.dev/sources/coffee-software)** · 1 min read · 1 upvotes · 0 comments

## Summary

Switching from the G1 garbage collector to ZGC in Java 21 eliminates stop-the-world pauses that previously caused half-second IPC call timeouts and retries. ZGC uses slightly more CPU continuously but avoids the usage spikes tied to GC pauses, allowing servers to run hotter at higher CPU utilization and reduce the number of instances needed.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=ENFc_6PQGjU>

## Questions this post answers

### Why would switching from G1 to ZGC in Java reduce IPC timeout errors?

ZGC eliminates stop-the-world garbage collection pauses that G1 can incur, which previously caused roughly half-second pauses triggering IPC call timeouts and retries. ZGC uses a bit more CPU continuously instead of spiking during GC events, which removes the latency peaks and lets servers run at higher sustained CPU utilization with fewer retries.

_Teams chasing GC-related latency spikes compare collector trade-offs like this one on daily.dev._

### Does ZGC use more CPU than G1 in Java applications?

Yes, ZGC consumes a small amount of extra CPU continuously compared to G1, but it avoids the CPU usage peaks caused by stop-the-world collection events. This trade-off lets services run hotter and more consistently, reducing the number of server instances needed overall, which was described as essentially free performance after migrating.

_Engineers weighing CPU versus latency trade-offs in JVM tuning follow comparisons like this on daily.dev._

## Similar posts on daily.dev

- [ZGC: A Decade of Redefining Java Performance](https://daily.dev/posts/zgc-a-decade-of-redefining-java-performance-vh5m1hxsj) · Inside Java · 4 upvotes · 0 comments
- [foojay – a place for friends of OpenJDK](https://daily.dev/posts/foojay-a-place-for-friends-of-openjdk-yn6v0glcw) · Foojay.io · 0 upvotes · 0 comments
- [The Ultimate 10 Years Java Garbage Collection Guide \(2016–2026\) – Choosing the Right GC for Every Workload](https://daily.dev/posts/the-ultimate-10-years-java-garbage-collection-guide-2016-2026-choosing-the-right-gc-for-every-wo-gcjhfz5py) · Jakarta EE · 3 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#jvm](https://daily.dev/tags/jvm)

[View this post on daily.dev](https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Java 21's ZGC trades a little CPU for zero stop-the-world pauses. No more IPC timeouts and retries.","url":"https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad"},"datePublished":"2026-10-01T01:50:52.212Z","dateModified":"2026-10-01T01:51:08.667Z","description":"Switching from the G1 garbage collector to ZGC in Java 21 eliminates stop-the-world pauses that previously caused half-second IPC call timeouts and retries....","image":"https://i.ytimg.com/vi/ENFc_6PQGjU/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/ENFc_6PQGjU/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Coffee + Software","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Coffee + Software","logo":"https://media.daily.dev/image/upload/s--nAGLloYn--/f_auto,q_auto/v1773648811/logos/coffee-software?_a=BAMAMiiu0","url":"https://daily.dev/sources/coffee-software"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,jvm","timeRequired":"PT1M","video":{"@type":"VideoObject","name":"Java 21's ZGC trades a little CPU for zero stop-the-world pauses. No more IPC timeouts and retries.","description":"Switching from the G1 garbage collector to ZGC in Java 21 eliminates stop-the-world pauses that previously caused half-second IPC call timeouts and retries....","thumbnailUrl":"https://i.ytimg.com/vi/ENFc_6PQGjU/sddefault.jpg","uploadDate":"2026-10-01T01:50:52.212Z","duration":"PT1M","url":"https://api.daily.dev/r/BBBYVxkAd","embedUrl":"https://www.youtube.com/embed/ENFc_6PQGjU"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Coffee + Software","item":"https://daily.dev/sources/coffee-software"},{"@type":"ListItem","position":3,"name":"Java 21's ZGC trades a little CPU for zero stop-the-world pauses. No more IPC timeouts and retries."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/java-21-s-zgc-trades-a-little-cpu-for-zero-stop-the-world-pauses-no-more-ipc-timeouts-and-retries--bbbyvxkad#faq","mainEntity":[{"@type":"Question","name":"Why would switching from G1 to ZGC in Java reduce IPC timeout errors?","acceptedAnswer":{"@type":"Answer","text":"ZGC eliminates stop-the-world garbage collection pauses that G1 can incur, which previously caused roughly half-second pauses triggering IPC call timeouts and retries. ZGC uses a bit more CPU continuously instead of spiking during GC events, which removes the latency peaks and lets servers run at higher sustained CPU utilization with fewer retries. Teams chasing GC-related latency spikes compare collector trade-offs like this one on daily.dev."}},{"@type":"Question","name":"Does ZGC use more CPU than G1 in Java applications?","acceptedAnswer":{"@type":"Answer","text":"Yes, ZGC consumes a small amount of extra CPU continuously compared to G1, but it avoids the CPU usage peaks caused by stop-the-world collection events. This trade-off lets services run hotter and more consistently, reducing the number of server instances needed overall, which was described as essentially free performance after migrating. Engineers weighing CPU versus latency trade-offs in JVM tuning follow comparisons like this on daily.dev."}}]}
```

