5

I have trouble with my android project, I did not touch anything and suddenly my app stopped working because of this error. Do you have some idea about what is happening? The error is this:

10-30 22:53:38.246: E/AndroidRuntime(19137): FATAL EXCEPTION: Thread-1210
10-30 22:53:38.246: E/AndroidRuntime(19137): java.lang.OutOfMemoryError
10-30 22:53:38.246: E/AndroidRuntime(19137):    at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316)
10-30 22:53:38.246: E/AndroidRuntime(19137):    at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:526)
10-30 22:53:38.246: E/AndroidRuntime(19137):    at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:549)
10-30 22:53:38.246: E/AndroidRuntime(19137):    at com.android.volley.toolbox.DiskBasedCache$CacheHeader.readHeader(DiskBasedCache.java:392)
10-30 22:53:38.246: E/AndroidRuntime(19137):    at com.android.volley.toolbox.DiskBasedCache.initialize(DiskBasedCache.java:155)
10-30 22:53:38.246: E/AndroidRuntime(19137):    at    com.android.volley.CacheDispatcher.run(CacheDispatcher.java:85)

please help me!!

Mixcels
  • 829
  • 1
  • 10
  • 23

4 Answers4

5

Looks like a fix for this went in June 24th .

DallinDyer
  • 1,318
  • 13
  • 14
3

-If the problem is due to Bitmaps then use

Lazy Imageloader for Bitmaps in listviews

-Make sure you dnt have too much work in its background task.

-And if possible please post your code from where you are getting this issue so we can also learn from it . THanks! :)

Hardy
  • 2,361
  • 19
  • 43
  • I am using UNiversal Image loader for loading images in my feedlist but I am getting at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316) error.I am using a viewpager with five fragments.What can be the reason behind this. – Karthika PB Jun 19 '15 at 07:04
2

This thing can be an easy fix for this

just add this line in your application tag in manifest file

android:largeHeap="true"

like this

<application
    android:largeHeap="true"
    android:allowBackup="true"
    ......
2

you can detect you memory leaks from Memory analyzer in eclipse which is taking much space and optimize your code by that

cnnagpal
  • 377
  • 1
  • 9