android java.lang.OutOfMemoryError

2019-04-28 10:59发布

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?

1条回答
姐就是有狂的资本
2楼-- · 2019-04-28 11:40

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.

查看更多
登录 后发表回答