code: public boolean isStarving(long now) {
      double starvingShare = getShare() * shareStarvingRatio;
      if (getGranted() >= Math.ceil(starvingShare)) {
        lastTimeAboveStarvingShare = now;
      }
  
      if (getGranted() >= Math.min(getShare(), getMinimum())) {
        lastTimeAboveMinimum = now;
      }
      if (now - lastPreemptTime < getMinPreemptPeriod()) {
        // Prevent duplicate preemption
        return false;
      }
      if (LOG.isDebugEnabled()) {
        LOG.debug("Pool:" + getName() +
            " lastTimeAboveMinimum:" + lastTimeAboveMinimum +
            " lastTimeAboveStarvingShare:" + lastTimeAboveStarvingShare +
            " minimumStarvingTime:" + getMinimumStarvingTime(now) +
            " shareStarvingTime:" + getShareStarvingTime(now) +
            " starvingTime:" + getStarvingTime(now));
      }
      if (getMinimumStarvingTime(now) >= 0) {
        LOG.info("Pool:" + getName() + " for type:" + getType() +
            " is starving min:" + getMinimum() +
            " granted:" + getGranted());
        lastPreemptTime = now;
        return true;
      }
      if (getShareStarvingTime(now) >= 0) {
        LOG.info("Pool:" + getName() + " for type:" + getType() +
            " is starving share:" + getShare() +
            " starvingRatio:" + shareStarvingRatio +
            " starvingShare:" + starvingShare +
            " granted:" + getGranted());
        lastPreemptTime = now;
        return true;
      }
      return false;
    }
docs: Check if the pool is starving now or not
  @param now current timestampe
  @return true if the pool is starving now, false otherwise