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 October 2022
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 263 contents
https://2022.javazone.no/#/program/b3b768f3-95f0-40b1-b99d-81b23233c54f
Profiler 101: Exposing Hidden Killers (Page last updated September 2022, Added 2022-10-29, Author Nitsan Wakart, Publisher JavaZone). Tips:
- Observe: CPU metrics, Allocation and GC metrics, and lock metrics including context switching.
- For allocation profiling in JMC, use tlab size rather than samples to view the graphs (needs 8.3+).
- Allocation can be expensive, do allocation profiling.
- ConcurrentHashMap is mostly lock free, but some operations (like some usages of computeIfAbsent) use locks.
- Common CPU bottlenecks: GC, String/StringBuilder/Regex, Encryption, Compression, Serialization.
- Common allocation bottlenecks: String/StringBuilder/Regex, ByteBuffer, Collection resizing, CopyOnWrite*, Serialization.
- Common lock bottlenecks: Shared maps/resources/caches, Random/SecureRandom, IO resources.
https://2022.javazone.no/#/program/77f4b4f6-094a-44ba-a23f-0fd505e8d9d6
Secrets of Performance Tuning Java on Kubernetes (Page last updated September 2022, Added 2022-10-29, Author Bruno Borges, Publisher JavaZone). Tips:
- The JVM ergonomics only chooses between two of the available GCs, selecting G1 as default (JVM11+, parallel before that) unless there is only one CPU available or less than 1792MB, when it choose the serial collector.
- Explicitly configure the JVM if it's running in a container based on the workload - choose the GC and heap size at minimum.
- Up to 4GB, start with parallel GC.
- In some scenarios performance is better if you "lie" to the JVM about how many cores it has available, so that it is more responsive (by letting the JVM think it has fewer cores available, so that the actual CPU times slices remain available). -XX:ActiveProcessorCount let's you explicitly set the number of cores available to the JVM, whatever the actual core count available to the JVM.
- JVM scaling is more efficient with fewer JVMs on more cores and memory rather than more JVMs on fewer cores and memory.
https://medium.com/@YuriShkuro/temple-six-pillars-of-observability-4ac3e3deb402
TEMPLE: Six Pillars of Observability (Page last updated September 2022, Added 2022-10-29, Author Yuri Shkuro, Publisher Medium). Tips:
- TEMPLE, the six pillars of observability: traces, events, metrics, profiles, logs, and exceptions.
- The metrics pillar: aggregatable numerical measurements with attributes. Metrics are great for monitoring, but aggregations lose details, which makes metrics not as good for troubleshooting & investigations.
- The logs pillar: logs provide the most detailed information available for investigating issues; structured logs can be used for analytics.
- The traces pillar: tracing usually refers to distributed tracing, a special form of structured logs that are request-scoped. Tracing captures log records and the causality between them, and once those records are stitched into a trace they represent the trajectory of a single request (or a workflow) through a distributed system end-to-end.
- Tracing let's you: monitor end-to-end latency across the system, which is difficult to observe with any other telemetry; isolate root causes to the system that is misbehaving; and attribute resource usage by different caller profiles or business lines.
- The events pillar: change events such as deployments of application code (and the corresponding code commits), configuration changes, experiments, DR-related traffic drains, auto-scaling events, etc. Very useful for identifying what recent event may have caused the current issue.
- The profiles pillar: a collection of stack traces with some metric associated with each stack trace, typically representing the number of times that stack trace was encountered. Very useful for deep diving in investigations.
- The exceptions pillar: exceptions have a particular structure which makes them best treated as a separate data type and UI; they also can quickly identify causes of issues.
Jack Shirazi
Back to newsletter 263 contents
Last Updated: 2023-02-26
Copyright © 2000-2023 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/newtips263.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us