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 June 2022
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 259 contents
https://blogs.oracle.com/javamagazine/post/curly-braces-java-network-transmission-compression
Network data transmission and compression in Java (Page last updated May 2022, Added 2022-06-29, Author Eric J. Bruno, Publisher Java Magazine). Tips:
- High-performance messaging software requires more than fast, efficient code; You also need to understand networking and I/O limitations.
- The fastest messaging code tends to be I/O bound - data compression is one possible solution to reducing the bound wait time.
- Obviously you should buffer IO to send and receive in chunks, this is always more efficient than byte-by-byte transfer.
- The more time an application spends sending data over the network, the lower the CPU utilization will be because the application is IO bound. This means moving to a faster server won't do much good, you need to improve your network I/O.
- Because IO bound applications tend to have spare CPU (because they spend a lot of time waiting), compressing the data can improve overall efficiency even though that means you are using more CPU. This decreases message sizes which means they get transferred in a shorter time and so waits are shorter.
https://www.youtube.com/watch?v=kQyGiTnEpls
How Class Data Sharing Can Speed up Your Application Startup (Page last updated January 2022, Added 2022-06-29, Author Rudy De Busscher, Publisher DevoxxUK). Tips:
- Class Data Sharing - CDS - stores info in a memory-mapped (hotspot: read-only file, J9 writeable). Loads fast, and can be shared (which would make overall memory requirements lower).
- Hotspot CDS: 1. create class list
-XX:+UseAppCDS -XX:DumpLoadedClassList=classes.list ...
(or from 17+ -XX:ArchiveClassesAtExit=...
); 2. create an archive -XX:+UseAppCDS -Xshare:dump -XX:SharedClassListFile=classes.list -XX:SharedArchiveFile=app-cds.jsa ...
; 3. use the archive -XX:+UseAppCDS -Xshare:on -XX:SharedArchiveFile=app-cds.jsa ...
.
- J9 CDS: -Xshareclasses, eg
-Xshareclasses:name=app-cds,cachedir=cds-dir -Xscmx500m ...
.
https://www.elastic.co/blog/create-your-own-instrumentation-with-the-java-agent-plugin
Create your own instrumentation with the Java Agent Plugin (Page last updated June 2022, Added 2022-06-29, Author Jack Shirazi, Publisher Elastic). Tips:
- A Java Agent can automatically instrument the application to trace and monitor the performance of applications and track errors.
- You can instrument technology that you don't have sources for, but this is more difficult than if you have the source code. Instrumenting requires choosing which methods and fields let you "hook" in to monitor the technology.
- You want instrumentation to provide execution duration and callouts, as well as any contextual metadata useful for tracing issues.
- Request handling entry and exit points are often a good point to target instrumentation.
- Byte Buddy is good for low-level byte-code instrumentation (the majority of Java APM agents use Byte Buddy as it is well designed for agent transformations).
Jack Shirazi
Back to newsletter 259 contents
Last Updated: 2024-09-29
Copyright © 2000-2024 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/newtips259.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us