Java Performance Tuning
Java(TM) - see bottom of page
Our valued sponsors who help make this site possible
JProfiler: Get rid of your performance problems and memory leaks!
Training online: Concurrency, Threading, GC, Advanced Java and more ...
Tips November 2025
|
JProfiler
|
|
Get rid of your performance problems and memory leaks!
|
|
JProfiler
|
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 300 contents
https://devm.io/java/opentelemetry-extensions-java
Enhancing Java Observability with OpenTelemetry Extensions (Page last updated October 2025, Added 2025-11-27, Author Jack Shirazi, Publisher JaxMagazine). Tips:
- The OpenTelemetry Java agent only instruments well-known frameworks, so custom code and niche libraries may not appear in traces. To increase visibility, use configuration options and extensions that extend instrumentation for the application.
- Inferred spans integrate two types of visibility: profiles and traces. While instrumentation inserts bytecodes into frameworks to trace the execution of the request, inferred spans runs a profiler alongside to identify execution profiles in non-framework code that get missed by the instrumentation.
- Capture stack traces when request execution exceeds a threshold (this can be done automatically with the OpenTelemetry agent and the span stacktrace extension).
https://www.youtube.com/watch?v=TqeSofn5_HA
When auto scaling isn't fast enough: Handling high volume live event traffic (Page last updated October 2025, Added 2025-11-27, Author Ivan Schwarz, Publisher Devoxx). Tips:
- Observability at second or sub-second granularity is necessary to understand spike data.
- One option for handling spikes is to keep spare resources on standby, ready to kick in immediately.
- One option for handling spikes is to change routing so that spikes are sufficiently distributed that no service gets overwhelmed.
- Look for patterns that indicate an upcoming spike so that the system can be prepared for the spike in advance.
- High throughput is important because the faster each request is handled, the sooner the next one can be served.
- Identify bottlenecks in the application or infrastructure and be conscious about where the limits are.
- Insert a queue or cache if the system can tolerate added latency, to let requests wait instead of dropping them.
- Do the bare minimum in the online (request-time) path - move any non-essential computation to offline processing.
- Log raw data during the online path and handle processing/transformation offline, where it's cheaper and safer.
- Design a reduced-service mode that focuses only on the core business functionality during high load.
- Separate core features from nice-to-have features, and disable nice-to-have features during high-scale traffic.
- The application should be able to switch into reduced-service mode dynamically when under pressure to avoid errors (e.g., return simpler responses instead of 503s).
- If acting in a request/response chain, a service under stress should be able to choose to proxy or "do no harm" rather than fail.
https://www.youtube.com/watch?v=sPNB4AjxCqI
Optimizing Database Connection Pools for Performance (Page last updated August 2025, Added 2025-11-27, Author NextGen AI Explorer, Publisher NextGen AI Explorer). Tips:
- Understand connection pooling basics: Connection pooling reduces the overhead of establishing new database connections by reusing long-lived connections.
- Use appropriate connection pool libraries: For Java applications, consider libraries like HikariCP, Apache DBCP, and C3P0 for efficient connection management.
- Tune connection pool settings: Adjust parameters such as maximum connections, connection timeout, and idle timeout for better performance. Monitor key metrics like connection wait time, total connections, and idle connections.
- Monitor and manage idle connections: Set an idle timeout to close unused connections, avoiding resource leaks and high memory usage. Implement connection validation checks to ensure health and prevent runtime errors.
- Balance connection pool size: Ensure your connection pool size is suitable for peak loads, but avoid over-allocating connections to prevent resource exhaustion.
- Use connection validation: Periodically check the health of connections to avoid errors at runtime and ensure consistent performance.
- Regularly review and adjust settings: Fine-tune connection pool settings incrementally, using load testing and performance metrics for data-driven decisions.
- Monitor connection pool metrics.
- Avoid common pitfalls: Overallocating connections; Ignoring connection leaks; Misconfiguring timeouts.
Jack Shirazi
Back to newsletter 300 contents
Last Updated: 2025-12-25
Copyright © 2000-2025 Fasterj.com. All Rights Reserved.
All trademarks and registered trademarks appearing on JavaPerformanceTuning.com are the property of their respective owners.
Java 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.
URL: http://www.JavaPerformanceTuning.com/news/newtips300.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us