The JVM is a rock-solid, battle-proven platform for developing and deploying applications. Thousands of engineering years have been invested into the facilities available on it, resulting in sophisticated garbage collection and just-in-time compilation mechanisms. The interaction between this platform and our applications is nuanced and often misunderstood.
In this 5-day workshop, the participants will learn about the two major runtime mechanisms of the JVM affecting performance - the JIT compiler and the garbage collector; techniques for writing performant JVM code and effective use of tools for analyzing performance.
Engineers, SREs and tech leads responsible for production JVM applications.
Basic knowledge of the JVM; basic experience running JVM applications in production.
- Overview of the JVM
- Garbage collection on the JVM
- Types of garbage collectors and choosing a garbage collector for a workload
- Analyzing allocations in JVM code
- Writing JVM code that is lean on allocations
- Analyzing bytecode to pinpoint allocations
- Monitoring garbage collector performance at runtime
- Understanding JIT compilation on the JVM
- Benchmarking code using JMH
- Analyzing JIT behaviour at runtime
- Writing JIT-friendly JVM code
5 days, 4 hours a day starting.
Attendance at this workshop is fully remote. Attendees will be provided with a link to a remote meeting session the day before the event, in which they can see and hear the workshop, ask the instructor questions, and chat with other attendees.
- Download the repository as a zip archive.
- Unzip the archive, usually by double-clicking on the file.
- Configure the source code files in the IDE or text editor of your choice.
-
Open up a terminal window.
-
Clone the repository.
git clone https://github.com/jdegoes/jvm-perf
-
Enable your target language,
scala
,kotlin
orjava
:mv src/main/{language}.skip src/main/{language}
For example,
mv src/main/java.skip src/main/java
. -
Launch project provided
sbt
.cd jvm-perf; ./sbt
-
Enter continuous compilation mode.
sbt:jvm-perf> ~ test:compile
Hint: You might get the following error when starting sbt:
[error] typesafe-ivy-releases: unable to get resource for com.geirsson#sbt-scalafmt;1.6.0-RC4: res=https://repo.typesafe.com/typesafe/ivy-releases/com.geirsson/sbt-scalafmt/1.6.0-RC4/jars/sbt-scalafmt.jar: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targe
It's because you have an outdated Java version, missing some newer certificates. Install a newer Java version, e.g. using Jabba, a Java version manager. See Stackoverflow for more details about the error.
Copyright© 2023 John A. De Goes. All rights reserved.