At first I would like to thank you for writing of this book and I must read this book because I feel it is "required reading" for all Java developers who want to do the best work in Java world.
And my question is if there is any part or paragraph about performance tuning of containerized Java applications? Of course we have to tune our applications for the best performance and the lowest memory and CPU consumption but what about tuning of the JVM itself?
For example there was added experimental support for Docker CPU and memory limits in Java 8u131 and 9. So now I can run Java application with flags -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap inside of the container and limit memory externally (Kubernetes manifests, Docker run commands, ...).
But is there something else what can help me to have smaller JVM instances?
Microservices are perfect for scaling and separating of business logic but each microservice eats another memory for JVM :-(
We don't specifically talk about microservices - but the general advice given in the book definitely still applies to microservices as well as more traditional Java apps.
One area that you should definitely keep an eye on is the development of the Graal-based Ahead-Of-Time (AOT) compiler. This allows simple Java applications to be compiled to native code, which can give much smaller memory footprint and code size.
The technology is still experimental, but is present in Java 10 (Note: Java 9 is now end-of-life and no longer supported - the current versions are 8 & 10 - at least until September when the new LTS release - 11 - comes out).
AOT compilation has some restrictions - currently reasonablt severe - but they should be eased over time as the tech develops. The biggest limitation at the moment is the "Closed World" assumption that jaotc requires.
Another topic of conversation around microservices is related to deployment in containers e.g. Docker. Java hasn't traditionally worked well in containers, as often it ends up looking outside the container to find the available resources - often leading to it blowing up the heap and making false assumptions about the available amount of resources the container has.
There are ways around this in pre Java 10, but Java 10 specifically introduced some features to improve Javas ability to run inside containers. You might find this article interesting.
You may also wish to look at OpenJ9, which is the open source IBM JVM. There's some really interesting Ahead of Time compilation techniques being experimented with there that can significantly reduce footprint.