Codetown ::: a software developer's community
August 28 2025, Newsletter no. 297 (this newsletter is available in html format at http://www.javaperformancetuning.com/news/news297.shtml )
As usual before a Java release, I'm listing all the new performance features in the upcoming release, this time for Java 25 (I have done this every 6 months, prior to each new release, you can track back to the previous February and August newsletters if you want to see what's new performance-wise in any particular release). In each of these pre-release newsletters, I give the new features, the performance benefits from each feature, and how to use the feature.
Java 25 is an LTS release, so will be supported for longer than the 6 month support life of non-LTS releases. That means many enterprises will plan to move to this release in the coming years, so all the features since 21 (the last LTS release) will become available to many more dev. If you want to see the full list of performance features for any version, they are conveniently listed together in my page ( https://htmlpreview.github.io/?https://github.com/jackshirazi/perf-... ) showing all the performance changes in each release of the JVM since Java/JDK/JVM 10.
On a different subject, I'll be giving an ( https://jaxlondon.com/devops-continuous-integration-delivery/opente... ) Extension Magic for the OpenTelemetry Java Agent at ( https://jaxlondon.com/ ) JAX London for anyone interested or already going.
Now on to the details of those Java 25 changes, including the options you have available to use them. And of course the tips from this month's articles, as ever are extracted into ( http://www.javaperformancetuning.com/news/newtips297.shtml ) this month's tips page.
A note from this newsletter's sponsor:
JProfiler
Get rid of your performance problems and memory leaks!
http://www.JavaPerformanceTuning.com/cgi-bin/urlon.pl?target=42
__News__
Java performance tuning related news - Java 25 performance changes
- JEP-514 Ahead-of-Time command-line simplification. Now allow the two-step `-XX:AOTMode=record -XX:AOTConfiguration=app.aotconf ` then `-XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot` to be replaced with a one-step `-XX:AOTCacheOutput=app.aot` at
https://openjdk.org/jeps/514
- JEP-515 Ahead-of-time method profiling - improves warmup time by making method-execution profiles from a previous run of an application instantly available. Uses the AOT cache mechanism, ie run the application, record its AOT configuration `java -XX:AOTMode=record -XX:AOTConfiguration=app.aotconf ..., create the cache `java -XX:AOTMode=create -XX:AOTConfiguration=app.aotconf -XX:AOTCache=app.aot ...` then run with the cache `java -XX:AOTCache=app.aot -cp app.jar ...` (also see above JEP 514 item which lets you use the one-step `-XX:AOTCacheOutput=app.aot` option, which equally applies to this feature) at
https://openjdk.org/jeps/515
- JEP-518 Reduces safepoint bias in JFR sampling. Nothing to turn on here, it's applied automatically if you use JDK 25+ at
https://openjdk.org/jeps/518
- JEP-519 Compact object headers are no longer experimental. Use with -XX:+UseCompactObjectHeaders. Should reduce memory and CPU a bit at
https://openjdk.org/jeps/519
- JEP-520 Adding JFR method timing and tracing via bytecode instrumentation. Instrumenting small amounts of non-critical code is fine, but if you instrument heavily looped code or extensively through the app, the overheads are huge. Java agents that do code instrumentation are verry very careful to be selective about what they instrument, and so should you! The JEP gives some nice examples, for example tracing HashMap.resize() with `java -XX:StartFlightRecording:jdk.MethodTrace#filter=java.util.HashMap::resize,filename=...` and timing every static initializer `java '-XX:StartFlightRecording:method-timing=::<clinit>,filename=...` at
https://openjdk.org/jeps/520
- JEP-521 Shenandoah generational mode is no longer experimental (but not yet default). Enable with -XX:+UseShenandoahGC -XX:ShenandoahGCMode=generational at
https://openjdk.org/jeps/521
- JDK-8356698 jfr.Contextual, has been introduced to mark fields in custom JFR events that contain contextual information relevant to other events occurring in the same thread. Example in the articles section of this newsletter at
https://bugs.openjdk.org/browse/JDK-8356698
- JDK-8343110 New getChars(int, int, char[], int) method in CharSequence and CharBuffer to bulk-read, likely to be more efficient than looping over characters one at a time at
https://bugs.openjdk.org/browse/JDK-8343110
- JDK-8328919 New Methods on BodyHandlers and BodySubscribers to limit the response body bytes size accepted by an HttpClient. For example `HttpClient.newHttpClient().send(request, BodyHandlers.limiting(BodyHandlers.ofString(), 1024))` limits the response size to 1k at
https://bugs.openjdk.org/browse/JDK-8328919
- JDK-8319447 Some updates to ForkJoinPool and CompletableFuture to make delayed, timeout and async tasks more efficient. Includes ScheduledExecutorService.submitWithTimeout, but mainly users of ForkJoinPools - including virtual thread scheduling - get more efficient operations for delayed actions, periodic actions, and cancellations at
https://bugs.openjdk.org/browse/JDK-8319447
- JDK-8356870 Thread dumps generated by HotSpotDiagnosticMXBean.dumpThreads and jcmd Thread.dump_to_file now include lock information at
https://bugs.openjdk.org/browse/JDK-8356870
- JDK-8241678 The periodic sampling functionality in PerfData has been removed, including the StatSampler and its controlling flag -XX:PerfDataSamplingInterval at
https://bugs.openjdk.org/browse/JDK-8241678
- JDK-8138614 StringBuilder and StringBuffer can now return the same String instead of always having to return a new one (eg the same empty string instance) at
https://bugs.openjdk.org/browse/JDK-8138614
- Metaspace is now printed separately from GC at
https://bugs.openjdk.org/browse/JDK-8356938
- JEP-506 Scoped Values (Fourth Preview). More efficient than thread-local variables, especially with large numbers of virtual threads at
https://openjdk.org/jeps/506
- JEP-502: Stable Values (Preview). An API for stable values, objects that hold immutable data. Treated as constants by the JVM, enabling the same performance optimizations that are available by declaring a field final at
https://openjdk.org/jeps/502
- JEP-505 Structured Concurrency (Fifth Preview). Simplify concurrent programming by grouping related tasks running in different threads at
https://openjdk.org/jeps/505
- JEP-507 Primitive types in patterns, instanceof, and switch (Third Preview). Unlikely to provide any significant performance improvement (fair enough as that's not the motivation) at
https://openjdk.org/jeps/507
- JEP-508 Vector API (Tenth Incubator). Vector computations that reliably compile at runtime to optimal vector hardware instructions. Useful for ML, GenAI, image processing, scientific processing, massive financial calculations, etc at
https://openjdk.org/jeps/508
- JEP-509 (Experimental), add CPU-time profiling to JFR on Linux systems only. New event `java -XX:StartFlightRecording=jdk.CPUTimeSample#enabled=true,filename=profile.jfr ...` or dynamically `jcmd PID JFR.start settings=/path/cpu_profile.jfc duration=4m` at
https://openjdk.org/jeps/509
__Tools__
Java performance tuning related tools
- Separate Metaspace and GC Printing per JDK-8356938 at
https://inside.java/2025/06/09/quality-heads-up/
- Understanding the safepoint bias avoidance of JEP 518 at
https://mostlynerdless.de/blog/2025/05/20/taming-the-bias-unbiased-...
- Ahead-of-Time (AOT) compilation at
https://javadevtech.com/2025/06/07/ahead-of-time-aot-cache-with-pro...
- Stable Values API JEP502 define immutable objects initialized at most once, offering the flexibility of lazy initialization with the performance benefits of final fields eg a singleton: `private static final StableValue<Thing>; INSTANCE = StableValue.create(Thing::new); public static Thing getInstance() {return INSTANCE.get();}` at
https://inside.java/2025/06/10/podcast-037/
__Articles__
- Method Timing in Java 25 with JFR and OpenTelemetry (Niklas Keller/kelunik's blog) at
https://blog.kelunik.com/2025/08/24/method-trace-java-25.html
- What's new for JFR in JDK 25 (Erik Gahlin/egahlin) at
https://egahlin.github.io/2025/05/31/whats-new-in-jdk-25.html
- Java 25's new CPU-Time Profiler (Johannes Bechberger/mostlynerdless) at
https://mostlynerdless.de/blog/2025/06/11/java-25s-new-cpu-time-pro...
__The latest performance tips__
All the performance tips extracted from the listed articles at
http://www.JavaPerformanceTuning.com/news/newtips297.shtml
This email has been sent to you because you have subscribed to the Java Performance Tuning newsletter. If you prefer not to receive any future newsletters, please use the URL
http://www.javaperformancetuning.com/cgi-bin/subscribe.pl?unsubscri...
Jack Shirazi
http://www.javaperformancetuning.com/contactUs.shtml
Java(TM) is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
JavaPerformanceTuning.com is not connected to Oracle Corporation and is not sponsored by Oracle Corporation
Codetown is a social network. It's got blogs, forums, groups, personal pages and more! You might think of Codetown as a funky camper van with lots of compartments for your stuff and a great multimedia system, too! Best of all, Codetown has room for all of your friends.
Created by Michael Levin Dec 18, 2008 at 6:56pm. Last updated by Michael Levin May 4, 2018.
Check out the Codetown Jobs group.
Uber Eats introduced INCA (Inventory and Catalog), a scalable system to handle vast product catalogs from supermarkets, pharmacies, and retail partners. Unlike the earlier restaurant-focused setup built for low SKUs and simple pass-through data, INCA supports large-scale inventories, rich metadata, and compliance needs essential for retail operations.
By Leela KumiliAirbnb engineering has published a detailed account of how it maintains high availability during Istio upgrades across tens of thousands of pods and thousands of VMs, all without downtime.
By Craig RisiSérgio Amorim shares how Revolut’s small DevOps team leverages a centralized systems catalog and automation to enable 1,300 engineers to build and deploy applications with speed and consistency. He explains how this approach reduces manual effort and improves observability, alerting, and database management at scale.
By Sérgio AmorimAWS has launched its eighth-generation Amazon EC2 R8i and R8i-flex instances, powered by custom Intel Xeon 6 processors. Designed for memory-intensive workloads, these instances offer up to 15% better price performance and enhanced memory throughput, making them ideal for real-time data processing and AI applications.
By Steef-Jan WiggersIn this article, authors discuss Model Context Protocol (MCP), an open standard designed to connect AI agents with tools and data they need. They also talk about how MCP empowers agent development, and its adoption in leading open-source frameworks.
By Sanjay Surendranath Girija, Lakshit Arora, Shashank Kapoor
© 2025 Created by Michael Levin.
Powered by
You need to be a member of Codetown to add comments!
Join Codetown