You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
Which lab is it that you're having issues with?
Lab: Docker for Java Developers
Description
When deploying Java applications in production one usually specifies the amount of memory available to the JVM (-Xmx) and other assorted configuration settings. Unfortunately, this is (usually) static configuration and therefore fixed in the container image. When specifying memory constraints (using cgroups) this is unfortunately not picked up by the JVM automatically, so there should be a section on memory management for dockerized Java apps.
Also, it is not easy to calculate the amount of JVM heap and the resulting cgroup limits, as the JVM also needs memory for other things, e.g. metaspace, JIT, ...
Which lab is it that you're having issues with?
Lab: Docker for Java Developers
Description
When deploying Java applications in production one usually specifies the amount of memory available to the JVM (-Xmx) and other assorted configuration settings. Unfortunately, this is (usually) static configuration and therefore fixed in the container image. When specifying memory constraints (using cgroups) this is unfortunately not picked up by the JVM automatically, so there should be a section on memory management for dockerized Java apps.
Java9 and Java8 > u131 provide limited support for this, see https://bugs.openjdk.java.net/browse/JDK-8170888 for details.
For older Java releases there is a good script from @fabric8io-images: https://github.com/fabric8io-images/java/blob/master/images/centos/openjdk8/jdk/container-limits
Also, it is not easy to calculate the amount of JVM heap and the resulting cgroup limits, as the JVM also needs memory for other things, e.g. metaspace, JIT, ...
A few words on the whole topic of JVM memory management for containers would be a very good addition. Articles like https://developers.redhat.com/blog/2017/03/14/java-inside-docker/ provide a good starting point.
The text was updated successfully, but these errors were encountered: