public void trimMemory(int level) {
        // Engine asserts this anyway when removing resources, fail faster and consistently
        Util.assertMainThread();
        // memory cache needs to be trimmed before bitmap pool to trim re-pooled Bitmaps too. See #687.
        memoryCache.trimMemory(level);
        bitmapPool.trimMemory(level);
    }
Clears some memory with the exact amount depending on the given level.

@see android.content.ComponentCallbacks2#onTrimMemory(int)
core/src/main/java/com/bumptech/glide/Glide.java