Why does Runtime.getRuntime.availableProcessors() always return 1 in OpenShift?
Issue
- Why does Runtime.getRuntime.availableProcessors() always return
1
in OpenShift, if bothresources.requests.cpu
andresources.limits.cpu
is unset. - If there is no cpu resource setting in the pod, I expect it to return the number of CPUs in the worker host.
Environment
- OpenJDK
- OpenJDK 1.8.191+
- 11
- -XX:+UseContainerSupport
- OpenShift
- 3.11
- 4.10
- 4.14+ (cgroupsv2 enabled by default)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.