@Override public void trim(MemoryTrimType trimType){
  ArrayList<Entry<K,V>> oldEntries;
  final double trimRatio=mCacheTrimStrategy.getTrimRatio(trimType);
synchronized (this) {
    int targetCacheSize=(int)(mCachedEntries.getSizeInBytes() * (1 - trimRatio));
    int targetEvictionQueueSize=Math.max(0,targetCacheSize - getInUseSizeInBytes());
    oldEntries=trimExclusivelyOwnedEntries(Integer.MAX_VALUE,targetEvictionQueueSize);
    makeOrphans(oldEntries);
  }
  maybeClose(oldEntries);
  maybeNotifyExclusiveEntryRemoval(oldEntries);
  maybeUpdateCacheParams();
  maybeEvictEntries();
}

@ Override public void trim ( MemoryTrimType trimType ) { ArrayList < Entry < K , V > > oldEntries ; final double trimRatio = mCacheTrimStrategy . getTrimRatio ( trimType ) ; synchronized ( this ) { int targetCacheSize = ( int ) ( mCachedEntries . getSizeInBytes ( ) * ( 1 - trimRatio ) ) ; int targetEvictionQueueSize = Math . max ( 0 , targetCacheSize - getInUseSizeInBytes ( ) ) ; oldEntries = trimExclusivelyOwnedEntries ( Integer . MAX_VALUE , targetEvictionQueueSize ) ; makeOrphans ( oldEntries ) ; } maybeClose ( oldEntries ) ; maybeNotifyExclusiveEntryRemoval ( oldEntries ) ; maybeUpdateCacheParams ( ) ; maybeEvictEntries ( ) ; }
trims the cache according to the specified trimming strategy and the given trim type .
