6

when i download large data from website, i got this error information:

I/global  (20094): Default buffer size used in BufferedInputStream constructor.
It would be better to be explicit if an 8k buffer is required.
D/dalvikvm(20094): GC freed 6153 objects / 3650840 bytes in 335ms
I/dalvikvm-heap(20094): Forcing collection of SoftReferences for 3599051-byte al
location
D/dalvikvm(20094): GC freed 320 objects / 11400 bytes in 144ms
E/dalvikvm-heap(20094): Out of memory on a 3599051-byte allocation.
I/dalvikvm(20094): "Thread-9" prio=5 tid=17 RUNNABLE
I/dalvikvm(20094):   | group="main" sCount=0 dsCount=0 s=0 obj=0x439b9480
I/dalvikvm(20094):   | sysTid=25762 nice=0 sched=0/0 handle=4065496

anyone can help me?

2
  • It runs out of memory, apparently... what exactly do you need help with?
    – flodin
    Commented May 30, 2010 at 11:29
  • 2
    At least provide the full stacktrace and some context information on how you download the data (see, the error message speaks of a BufferedInputStream) Commented May 30, 2010 at 13:11

1 Answer 1

1

Individual apps do not have access to all available device memory. If you're downloading a large data set consider writing it to the SD card as you go rather than trying to hold it entirely in memory.

3
  • 4
    OutOfMemory exceptions usually don't have to do with disk memory but heap or memory/ram. (see java.sun.com/j2se/1.4.2/docs/api/java/lang/…) Commented May 30, 2010 at 19:39
  • hi, adamp, i was wirte to SDCard, but it still OutOfMemory. Could you tell me how to recycle Drawable? Commented Jun 1, 2010 at 9:26
  • @Toni: You can often process data in chunks to or from local storage in situations where attempting to load the entire data set into memory at once would result in OOM. @xiangdream: If your large data are images in the form of Drawables (BitmapDrawables?) take a look at the BitmapFactory decoding methods and the inSampleSize field of BitmapFactory.Options. You can resample an image to a smaller size while loading it to save memory. developer.android.com/reference/android/graphics/… Some more information about what you're trying to do would be helpful. :)
    – adamp
    Commented Jun 1, 2010 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.