@Override
  public E poll(long timeout, TimeUnit unit) throws InterruptedException {
    if (Thread.interrupted()) {
      throw new InterruptedException();
    }
    E result = super.poll(timeout, unit);
    if (result != null) {
      postRemove(result);
      stats.remove();
    }
    return result;
  }
Creates new OverflowQueueWithDMStats with a maximum capacity.
geode-core/src/main/java/org/apache/geode/distributed/internal/OverflowQueueWithDMStats.java