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
精彩评论