Backend Development 19 min read

JDK17 Upgrade for Search Recommendation Service: Process, Issues, and Performance Improvements

This article details the motivation, steps, encountered challenges, and measurable performance gains of upgrading a high‑traffic search recommendation service from JDK 8 to JDK 17, highlighting new Java syntax, modern GC algorithms, deployment procedures, and the resulting reductions in latency, GC pause times, and heap usage.

Zhuanzhuan Tech
Zhuanzhuan Tech
Zhuanzhuan Tech
JDK17 Upgrade for Search Recommendation Service: Process, Issues, and Performance Improvements

As the traffic of the ZhaiZhai search recommendation service grew, the existing JDK 8 (CMS and G1) caused frequent and long garbage‑collection pauses, hurting availability and user experience. The team aimed to reduce GC pause time by over 90% by upgrading to JDK 17, which offers low‑latency collectors such as ZGC and Shenandoah.

JDK 17, the latest Long‑Term Support release, provides backward compatibility while introducing new language features (local‑variable type inference, enhanced Stream API, switch expressions, text blocks, records, sealed classes) and modern GC algorithms. Sample code snippets illustrate these features, e.g., // Traditional variable declaration String str = "hello"; // Type inference with var var str = "hello";

The upgrade process involved installing JDK 17 (Eclipse Temurin), updating IDE and Maven configurations, and adjusting JVM startup parameters (e.g., -XX:+UseZGC , -Xms6g -Xmx6g ). Deployment was performed on 50% of the service nodes while the remaining nodes stayed on JDK 8 for comparison.

During compilation and deployment, several issues arose: malformed Unicode in Maven resolver files, missing JavaFX packages, incompatible JVM options, reflective access restrictions, and removed annotations. Each problem was resolved with specific commands or dependency updates, such as deleting problematic files, adding --add-opens flags, or including javax.annotation-api .

Performance measurements after the upgrade showed notable improvements: TP9999 latency dropped from 601 ms to 458 ms (‑23.78%), ZGC pause time fell from 355 ms per minute to 0.37 ms (‑99.83%), and average heap usage decreased by 17.2%. Tables and charts (omitted here) illustrate these gains.

In summary, the JDK 17 migration successfully mitigated GC‑induced latency spikes, reduced memory consumption, and provided valuable experience with new Java features and cross‑team coordination, paving the way for a full migration of the core recommendation service.

BackendJavaPerformanceGarbage CollectionUpgradejdk17
Zhuanzhuan Tech
Written by

Zhuanzhuan Tech

A platform for Zhuanzhuan R&D and industry peers to learn and exchange technology, regularly sharing frontline experience and cutting‑edge topics. We welcome practical discussions and sharing; contact waterystone with any questions.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.