JDK-8196595 : Release Note: Java Improvements for Docker Containers
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u191,10
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2018-02-01
  • Updated: 2019-04-09
  • Resolved: 2018-02-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10Resolved 8u191Resolved
Description
The following changes have been introduced in JDK 10 to improve the execution and configurability of Java running in Docker containers: 

* JDK-8146115 Improve docker container detection and resource configuration usage

The JVM has been modified to be aware that it is running in a Docker container and will extract container specific configuration information instead of querying the operating system.  The information being extracted is the number of CPUs and total memory that have been allocated to the container.  The total number of CPUs available to the Java process is calculated from any specified cpu sets, cpu shares or cpu quotas.  This support is only available on Linux based platforms.  This new support is enabled by default and can be disabled in the command line with the JVM option:

   `-XX:-UseContainerSupport`

In addition, this change adds a JVM option that provides the ability to specify the number of CPUs that the JVM will use:

   `-XX:ActiveProcessorCount=count`

This count overrides any other automatic CPU detection logic in the JVM.

* JDK-8186248 Allow more flexibility in selecting Heap % of available RAM

Three new JVM options have been added to allow Docker container users to gain more fine grained control over the amount of system memory that will be used for the Java Heap:  

  * `-XX:InitialRAMPercentage`
  * `-XX:MaxRAMPercentage`
  * `-XX:MinRAMPercentage`

These options replace the deprecated Fraction forms (`-XX:InitialRAMFraction`, `-XX:MaxRAMFraction`, and `-XX:MinRAMFraction`).

* JDK-8179498 attach in linux should be relative to /proc/pid/root and namespace aware

This bug fix corrects the attach mechanism when trying to attach from a host process to a Java process that is running in a Docker container.