code: public static int defaultNumThreads(int numUsableCores) {
      final int availableCores;
      if (numUsableCores > 0) {
        availableCores = numUsableCores;
      } else {
        availableCores = Runtime.getRuntime().availableProcessors();
      }
      return Math.min(availableCores, MAX_DEFAULT_NETTY_THREADS);
    }
docs: Returns the default number of threads for both the Netty client and server thread pools.
  If numUsableCores is 0, we will use Runtime get an approximate number of available cores.