8264136: Active processor count may be underreported #3177
In cgroups environments the available CPU resources are described by the minimal guaranteed amount and maximal allowed amount (see eg. this post).
Just for the record, the algorithm is a bit more involved - it computes both values, the one based on the minimal guaranteed amount (if specified) as well as the one based on the maximal allowed amount (again, if specified) and then takes the lesser of the two. In reality, when both parts are set the minimal guaranteed amount will always be less or equal to the maximal allowed amount so, as a simplification, we can consider the minimal guaranteed amount to be the base for the available CPU count calculation if it is set.
For systems with 'elastic' setup where the minimal guaranteed amount and maximal allowed amount are not equal this definition of available CPUs can lead to misconfiguration of anything relying on the reported number of cores - eg. number of GC threads, compiler thread or the fork-join pool size.
The proposed fix is to disregard the minimal guaranteed amount in the calculation when
To checkout this PR locally:
To update a local copy of the PR:
@jbachorik I've added a few comments and questions to the bug (with some background info): https://bugs.openjdk.java.net/browse/JDK-8264136?focusedCommentId=14409876&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14409876