Java Tuning

How much time and effort do you put into tuning the JVM for your application? Do you just accept the defaults and run with it? Do you set the max heap size, and that’s good enough? Or do you reach in and really adjust the settings to fit your app perfectly? Defaults It seems like … Read more

Java JMX in Docker

How to enable JMX in a container running in a local, or remote Docker container. These are the flags that I typically pass: This enables jmx, allows it to be remote, specifies port 9000, and allows it to bind to all the network interfaces. Then, you just need to make sure to expose port 9000 … Read more

Java Memory Settings in Docker

I have not yet been able to find any correct example of setting Java memory settings when running in Docker containers.  There are numerous examples, yet they are all wrong. Wrong Example 1: Setting Nothing By default, Java doesn’t look at the cgroups restrictions that Docker uses for resource isolation.  So, if max heap is … Read more