RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v2]

Severin Gehwolf sgehwolf at openjdk.org
Tue Apr 16 15:19:41 UTC 2024


On Tue, 16 Apr 2024 14:40:46 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

> IMHO `is_containerized()` is OK to return `false` even when running in a container but with no limitations set.

The idea here is to use this property to tune OpenJDK for in-container, specifically k8s, use. In such a setup it's custom to run a single process within set resource constraints. In order to do this, we need a reliable way to distinguish that vs. non-containerized setup. If somebody really wants to run OpenJDK in a container expecting it to run like a physical OpenJDK deployment, that's when `-XX:-UseContainerSupport` should be used.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/18201#issuecomment-2059344194


More information about the serviceability-dev mailing list