开发者

How to increase heap memory in android

开发者 https://www.devze.com 2023-02-12 06:46 出处:网络
I am getting a value from webservice. I am parsing the value and adding it to arraylist while adding array list.

I am getting a value from webservice. I am parsing the value and adding it to arraylist while adding array list.

I am getting out of m开发者_开发百科emory error in arraylist. Can anybody tell how to avoid this?

I read that one way to avoid out of memory error using increase heap size, but I don't how to do this - Can anybody tell how to do? Is there anyother way to avoid out of memory error?


If you have a OutOfMemoryException when you just add a value to an ArrayList it's probably because you have a memory leak somewhere. Use largeHeap="true" only if you exactly know what object take lot of memory and you can't avoid it.


You might be having memory leaks in your application - You really shouldn't be having memory issues otherwise. Android sometimes also has issues with automatic garbage collection, so try placing System.gc() and seeing whether that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消