OutOfMemoryError what to increase and how?

Posted by Pentium10 on Stack Overflow See other posts from Stack Overflow or by Pentium10
Published on 2010-05-21T10:04:54Z Indexed on 2010/05/21 10:10 UTC
Read the original article Hit count: 507

I have a really long collection with 10k items, and when running a toString() on the object it crashes. I need to use this output somehow.

05-21 12:59:44.586: ERROR/dalvikvm-heap(6415): Out of memory on a 847610-byte allocation.
05-21 12:59:44.636: ERROR/dalvikvm(6415): Out of memory: Heap Size=15559KB, Allocated=12932KB, Bitmap Size=613KB
05-21 12:59:44.636: ERROR/AndroidRuntime(6415): Uncaught handler: thread main exiting due to uncaught exception
05-21 12:59:44.636: ERROR/AndroidRuntime(6415): java.lang.OutOfMemoryError
05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)
05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:155)
05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.lang.StringBuilder.append(StringBuilder.java:202)
05-21 12:59:44.636: ERROR/AndroidRuntime(6415):     at java.util.AbstractCollection.toString(AbstractCollection.java:384)

I need step by step guide how to increase the heap for and Android application. I don't run the command line.

© Stack Overflow or respective owner

Related posts about java

Related posts about android