private synchronized void trimToSize(int size) {
        while (currentSize > size) {
            final Bitmap removed = strategy.removeLast();
            // TODO: This shouldn't ever happen, see #331.
            if (removed == null) {
                if (Log.isLoggable(TAG, Log.WARN)) {
                    Log.w(TAG, "Size mismatch, resetting");
                    dumpUnchecked();
                }
                currentSize = 0;
                return;
            }

            tracker.remove(removed);
            currentSize -= strategy.getSize(removed);
            removed.recycle();
            evictions++;
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "Evicting bitmap=" + strategy.logBitmap(removed));
            }
            dump();
        }
    }
Constructor for LruBitmapPool.

@param maxSize The initial maximum size of the pool in bytes.
@param allowedConfigs A white listed set of {@link Bitmap.Config} that are allowed to be put
                      into the pool. Configs not in the allowed set will be rejected.
core/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/LruBitmapPool.java