Codota Logo
MemoryCache.getCurrentSize
Code IndexAdd Codota to your IDE (free)

How to use
getCurrentSize
method
in
com.bumptech.glide.load.engine.cache.MemoryCache

Best Java code snippets using com.bumptech.glide.load.engine.cache.MemoryCache.getCurrentSize (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: bumptech/glide

private long getFreeMemoryCacheBytes() {
 return memoryCache.getMaxSize() - memoryCache.getCurrentSize();
}
origin: bumptech/glide

@VisibleForTesting
PreFillQueue generateAllocationOrder(PreFillType... preFillSizes) {
 final long maxSize =
   memoryCache.getMaxSize() - memoryCache.getCurrentSize() + bitmapPool.getMaxSize();
 int totalWeight = 0;
 for (PreFillType size : preFillSizes) {
  totalWeight += size.getWeight();
 }
 final float bytesPerWeight = maxSize / (float) totalWeight;
 Map<PreFillType, Integer> attributeToCount = new HashMap<>();
 for (PreFillType size : preFillSizes) {
  int bytesForSize = Math.round(bytesPerWeight * size.getWeight());
  int bytesPerBitmap = getSizeInBytes(size);
  int bitmapsForSize = bytesForSize / bytesPerBitmap;
  attributeToCount.put(size, bitmapsForSize);
 }
 return new PreFillQueue(attributeToCount);
}
origin: guolindev/giffun

private int getFreeMemoryCacheBytes() {
  return memoryCache.getMaxSize() - memoryCache.getCurrentSize();
}
origin: palaima/DebugDrawer

private void refresh() {
  final BitmapPool pool = glide.getBitmapPool();
  final String total = getSizeString(pool.getMaxSize());
  final String memCacheCurrent = getSizeString(memoryCache.getCurrentSize());
  final String memCacheMax = getSizeString(memoryCache.getMaxSize());
  poolSizeLabel.setText(total);
  memCacheCurrentLabel.setText(memCacheCurrent);
  memCacheMaxLabel.setText(memCacheMax);
}
origin: guolindev/giffun

PreFillQueue generateAllocationOrder(PreFillType[] preFillSizes) {
  final int maxSize = memoryCache.getMaxSize() - memoryCache.getCurrentSize() + bitmapPool.getMaxSize();
  int totalWeight = 0;
  for (PreFillType size : preFillSizes) {
    totalWeight += size.getWeight();
  }
  final float bytesPerWeight = maxSize / (float) totalWeight;
  Map<PreFillType, Integer> attributeToCount = new HashMap<PreFillType, Integer>();
  for (PreFillType size : preFillSizes) {
    int bytesForSize = Math.round(bytesPerWeight * size.getWeight());
    int bytesPerBitmap = getSizeInBytes(size);
    int bitmapsForSize = bytesForSize / bytesPerBitmap;
    attributeToCount.put(size, bitmapsForSize);
  }
  return new PreFillQueue(attributeToCount);
}
origin: mozilla-tw/Rocket

private int getFreeMemoryCacheBytes() {
 return memoryCache.getMaxSize() - memoryCache.getCurrentSize();
}
origin: mozilla-tw/Rocket

PreFillQueue generateAllocationOrder(PreFillType... preFillSizes) {
 final int maxSize =
   memoryCache.getMaxSize() - memoryCache.getCurrentSize() + bitmapPool.getMaxSize();
 int totalWeight = 0;
 for (PreFillType size : preFillSizes) {
  totalWeight += size.getWeight();
 }
 final float bytesPerWeight = maxSize / (float) totalWeight;
 Map<PreFillType, Integer> attributeToCount = new HashMap<>();
 for (PreFillType size : preFillSizes) {
  int bytesForSize = Math.round(bytesPerWeight * size.getWeight());
  int bytesPerBitmap = getSizeInBytes(size);
  int bitmapsForSize = bytesForSize / bytesPerBitmap;
  attributeToCount.put(size, bitmapsForSize);
 }
 return new PreFillQueue(attributeToCount);
}
com.bumptech.glide.load.engine.cacheMemoryCachegetCurrentSize

Javadoc

Returns the sum of the sizes of all the contents of the cache in bytes.

Popular methods of MemoryCache

  • getMaxSize
    Returns the current maximum size in bytes of the cache.
  • clearMemory
    Evict all items from the memory cache.
  • put
    Add bitmap to the cache with the given key.
  • remove
    Removes the value for the given key and returns it if present or null otherwise.
  • setResourceRemovedListener
    Set the listener to be called when a bitmap is removed from the cache.
  • setSizeMultiplier
    Adjust the maximum size of the cache by multiplying the original size of the cache by the given mult
  • trimMemory
    Trim the memory cache to the appropriate level. Typically called on the callback onTrimMemory.

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • String (java.lang)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now