Runtime Processors Calculation for the JVM in Kubernetes Containers

3/22/2019

I am running a JVM in a K8s pods, and I have allocated it 512m of CPU and 1Gi of memory. When we execute

In context of Runtime.getRuntime().availableProcessors(),

  1. what would be the value returned? I want to know this since some of the libraries like Couchbase Java client, RxJava etc. rely on this value to determine the number of threads in various thread-pools.

  2. How is the value 512m interpreted. Would it take the floor or the ceil of this value? Or is there a different way to compute this altogether?

-- Prashant Pandey
containers
jvm
kubernetes

0 Answers