Android Question Out of memory with StringBuilder

Alessandro71

Well-Known Member
Licensed User
Longtime User
Any known memory limit with string builder?
This happened while building a JSON string

~e:java.lang.OutOfMemoryError: Failed to allocate a 150994952 byte allocation with 25165824 free bytes and 72MB until OOM, max allowed footprint 150793064, growth limit 201326592
~e: at java.util.Arrays.copyOf(Arrays.java:3260)
~e: at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:125)
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
pictures inside...
and I thought 150MB on a 3GB device should not be issue...
I'll switch to building and uploading a file instead
 
Upvote 0
Top