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 April 2021
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 245 contents
https://www.youtube.com/watch?v=bGYrEeZwA0U
What we Learned Moving Hundreds of Services into the Cloud (Page last updated March 2021, Added 2021-04-28, Author Jack Shirazi, Publisher Java2Days). Tips:
- For any JVM based application it is essential to expose and capture the JVM performance statistics.
- JVM metrics to monitor: ClassLoading, Compilation, GarbageCollector, Memory, MemoryPool, OperatingSystem, Runtime, Threading, BufferPool
- Application metrics to monitor: Latencies, rates and counts, connection pool, thread pools, circuit breaker metrics
- Having balanced requests across instances is important, otherwise instances can be overloaded and you can have a cascaded failure of all instances. Persistent/sticky connections are problematic, Keep Alive Requests need to be set - don?t rely on defaults.
- Don't cache DNS lookup results forever (which is the default). Use a refresh of 60 seconds or less
- For containers, note that the JVM rounds off CPU values to the nearest upper integer eg if the CPU limit is set to 1.8, the JVM will think it sees 2 cores (which is used for the default number of GC threads and lambda thread pool)
- Throttling doesn?t matter if you are achieving your SLOs!
https://www.youtube.com/watch?v=mcfubUmbZhQ
Monitoring and Troubleshooting Tools in the JDK (Page last updated March 2021, Added 2021-04-28, Author Poonam Parhar, Publisher Oracle). Tips:
- Solving an issue: Identify the error; collect relevant diagnostic data; analyze the data to find the cause
- JDK/JVM monitoring tools: jconsole (basic stats and JMX, jconsole consumes significant resources locally but not on the JVM); jps (lists running JVMs); jstat (JVM stats, and with jstatd allows for remote monitoring); jmc (JMX, JVM internal stats, and JFR recordings)
- JDK/JVM troubleshooting tools: jcmd (executes local diagnostic commands using the attach api: heap, classes, thread stacks, native memory, metaspace, config, jfr), jdb (debugger), jinfo (config info), jmap (heap dumps and histograms, classloader stats, finalizer info), jstack (thread stack traces and locks), jhsdb (attaches to hung JVMs and crash dumps for analysis), jfr (performance event recordings analysis).
https://www.youtube.com/watch?v=9le3sboLLck
JMC 8 and Beyond (Page last updated January 2021, Added 2021-04-28, Author Marcus Hirt, Publisher JChampions Conf). Tips:
- JMC is not just a tool for visualizing JVM metrics and JFR recordings, it is also a library that can be used for these things
- JMC includes: JMX console; invoking jcmd diagnostic commands; triggering actions on conditions (eg dumping thread stacks on high CPU); threads viewer; deadlock detection; allocation profiling; JOverflow heap waste analysis (handles heap dumps); JFR viewer.
Jack Shirazi
Back to newsletter 245 contents
Last Updated: 2025-02-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/newtips245.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us