Volley out of memory error, weird allocation attempt

In the streamToBytes(), first it will new bytes by the cache file length, does your cache file was too large than application maximum heap size ? private static byte[] streamToBytes(InputStream in, int length) throws IOException { byte[] bytes = new byte[length]; … } public synchronized Entry get(String key) { CacheHeader entry = mEntries.get(key); File file … Read more