boolean needsCompaction() {
    if (!isCompactionPossible()) {
      return false;
    }
    if (getParent().getCompactionThreshold() == 100) {
      return true;
    }
    if (getParent().getCompactionThreshold() == 0) {
      return false;
    }
    // otherwise check if we have enough garbage to collect with a compact
    long rvHWMtmp = totalCount.get();
    if (rvHWMtmp > 0) {
      long tlc = totalLiveCount.get();
      if (tlc < 0) {
        tlc = 0;
      }
      double rv = tlc;
      return ((rv / (double) rvHWMtmp) * 100) <= parent.getCompactionThreshold();
    } else {
      return true;
    }
  }
Return true if it is possible that compaction of this oplog will be done.
geode-core/src/main/java/org/apache/geode/internal/cache/OverflowOplog.java