@Override
  public void maybeEvictEntries() {
    ArrayList<Entry<K, V>> oldLFUEntries;
    ArrayList<Entry<K, V>> oldMFUEntries;
    synchronized (this) {
      int maxCount =
          Math.min(
              mMemoryCacheParams.maxEvictionQueueEntries,
              mMemoryCacheParams.maxCacheEntries - getInUseCount());
      int maxSize =
          Math.min(
              mMemoryCacheParams.maxEvictionQueueSize,
              mMemoryCacheParams.maxCacheSize - getInUseSizeInBytes());
      int LFUMaxCount = (int) ((long) maxCount * mLFUFractionPromil / TOTAL_PROMIL);
      int LFUMaxSize = (int) ((long) maxSize * mLFUFractionPromil / TOTAL_PROMIL);
      oldLFUEntries =
          trimExclusivelyOwnedEntries(
              LFUMaxCount, LFUMaxSize, mLeastFrequentlyUsedExclusiveEntries, ArrayListType.LFU);
      oldMFUEntries =
          trimExclusivelyOwnedEntries(
              maxCount - LFUMaxCount,
              maxSize - LFUMaxSize,
              mMostFrequentlyUsedExclusiveEntries,
              ArrayListType.MFU);
      makeOrphans(oldLFUEntries, oldMFUEntries);
    }
    maybeClose(oldLFUEntries, oldMFUEntries);
    maybeNotifyExclusiveEntriesRemoval(oldLFUEntries, oldMFUEntries);
  }
Removes the exclusively owned items until the cache constraints are met.

<p>This method invokes the external {@link CloseableReference#close} method, so it must not be
called while holding the <code>this</code> lock.
imagepipeline-base/src/main/java/com/facebook/imagepipeline/cache/AbstractAdaptiveCountingMemoryCache.java