Java application gets incorrect number of available CPUs in OpenShift

Solution Verified - Updated -

Issue

  • Why my Java application gets incorrect number of available CPUs in OpenShift
  • Why Runtime.getRuntime().availableProcessors() method returns incorrect number of processors available to the JVM? this will cause unexpected results and slowness in our application

Environment

  • OpenShift Container Platform
  • Java 8
  • OpenJDK prio to 8u191

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content