public void purge() {
    if (purgeLock.tryLock()) {// no parallel purge
      try {
        while (true) {
          @SuppressWarnings("unchecked")
          Reference<V> ref = (Reference<V>) staleRefQueue.poll();
          if (ref == null) {
            break;
          }
          referenceCache.remove(getReferenceKey(ref), ref);
        }
      } finally {
        purgeLock.unlock();
      }
    }
  }
Removes stale references of shared objects from the pool. References newly becoming stale may
still remain.
<p/>
The implementation of this method is expected to be lightweight when there is no stale
reference with the Oracle (Sun) implementation of {@code ReferenceQueue}, because
{@code ReferenceQueue.poll} just checks a volatile instance variable in {@code ReferenceQueue}.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ObjectPool.java