开发者

java.lang.OutOfMemoryError

how to solve this issue.... any alternative or how to increase memory??

12-03 15:24:21.302: ERROR/AndroidRuntime(423): java.lang.OutOfMemoryError
12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at java.lang.String.<init>(String.java:468)
12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at java.lang.AbstractStringBuilder.toString(AbstractStringBuilder.java:659)
12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at java.lang.StringBuffer.toString(StringBuffer.java:720)
12-03 15:24:21.302: ERROR/AndroidRuntime(423):     at com.exam开发者_JS百科ple.my.Map.stringtoArray(Map.java:270)


When and where this is happening?

If you use Eclipse you can increase its memory allocation by - http://www.avajava.com/tutorials/lessons/how-do-i-allocate-more-memory-to-eclipse.html

In other case - you can increase the memory of the emulator - when you create new emulator there is option to set its memory. The default is 16MB, you can increase it to what you want (I recommend to check the targeted phone's memory heap).

Edit: As Mathias Lin said, changing the heap allocation of rooted device is UNACCEPTABLE!


Looks like might be working with a very large String. If you're working with a large amount of characters from a file or something, then it's better to use the Reader and Writer classes to process the data as a stream. Without seeing any code to know what you're trying to do, though, this is just a guess.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜