@Override public void release(V value){
  Preconditions.checkNotNull(value);
  final int bucketedSize=getBucketedSizeForValue(value);
  final int sizeInBytes=getSizeInBytes(bucketedSize);
synchronized (this) {
    final Bucket<V> bucket=getBucket(bucketedSize);
    if (!mInUseValues.remove(value)) {
      FLog.e(TAG,"release (free, value unrecognized) (object, size) = (%x, %s)",System.identityHashCode(value),bucketedSize);
      free(value);
      mPoolStatsTracker.onFree(sizeInBytes);
    }
 else {
      if (bucket == null || bucket.isMaxLengthExceeded() || isMaxSizeSoftCapExceeded() || !isReusable(value)) {
        if (bucket != null) {
          bucket.decrementInUseCount();
        }
        if (FLog.isLoggable(FLog.VERBOSE)) {
          FLog.v(TAG,"release (free) (object, size) = (%x, %s)",System.identityHashCode(value),bucketedSize);
        }
        free(value);
        mUsed.decrement(sizeInBytes);
        mPoolStatsTracker.onFree(sizeInBytes);
      }
 else {
        bucket.release(value);
        mFree.increment(sizeInBytes);
        mUsed.decrement(sizeInBytes);
        mPoolStatsTracker.onValueRelease(sizeInBytes);
        if (FLog.isLoggable(FLog.VERBOSE)) {
          FLog.v(TAG,"release (reuse) (object, size) = (%x, %s)",System.identityHashCode(value),bucketedSize);
        }
      }
    }
    logStats();
  }
}

@ Override public void release ( V value ) { Preconditions . checkNotNull ( value ) ; final int bucketedSize = getBucketedSizeForValue ( value ) ; final int sizeInBytes = getSizeInBytes ( bucketedSize ) ; synchronized ( this ) { final Bucket < V > bucket = getBucket ( bucketedSize ) ; if ( ! mInUseValues . remove ( value ) ) { FLog . e ( TAG , "release (free, value unrecognized) (object, size) = (%x, %s)" , System . identityHashCode ( value ) , bucketedSize ) ; free ( value ) ; mPoolStatsTracker . onFree ( sizeInBytes ) ; } else { if ( bucket == null || bucket . isMaxLengthExceeded ( ) || isMaxSizeSoftCapExceeded ( ) || ! isReusable ( value ) ) { if ( bucket != null ) { bucket . decrementInUseCount ( ) ; } if ( FLog . isLoggable ( FLog . VERBOSE ) ) { FLog . v ( TAG , "release (free) (object, size) = (%x, %s)" , System . identityHashCode ( value ) , bucketedSize ) ; } free ( value ) ; mUsed . decrement ( sizeInBytes ) ; mPoolStatsTracker . onFree ( sizeInBytes ) ; } else { bucket . release ( value ) ; mFree . increment ( sizeInBytes ) ; mUsed . decrement ( sizeInBytes ) ; mPoolStatsTracker . onValueRelease ( sizeInBytes ) ; if ( FLog . isLoggable ( FLog . VERBOSE ) ) { FLog . v ( TAG , "release (reuse) (object, size) = (%x, %s)" , System . identityHashCode ( value ) , bucketedSize ) ; } } } logStats ( ) ; } }
releases the given value to the pool . in a few cases , the value is ' freed ' instead of being released to the pool . if - the pool currently exceeds its max size or - if the value does not map to a bucket that ' s currently maintained by the pool , or - if the bucket for the value exceeds its maxlength , or - if the value is not recognized by the pool then , the value is ' freed ' .
