The real error is
Out of memory on a 23818256-byte allocation
.
You are attempting to allocate a ~22MB block of memory, and you do not
have that much free memory available, let alone a contiguous block that
large.In this case, this is coming from a drawable resource. ~22MB would be a truly massive image, more like 2400x2400 than 1200x1200. Your process heap size is 48MB, which is substantial, but ~22MB is almost half your heap budget.
I would recommend that you find out which drawable resource this is (looks like it might be a background of a
RelativeLayout
),
then reduce its size and the sizes of similar images. Here, by "size" I
mean total pixel count, not the on-disk size, as what matters is the
decompressed size in RAM, not how big the image is on disk.Also, this might be an issue of resource directories. For example, if you put your 1200x1200 image in
res/drawable/
, that effectively is synonymous with res/drawable-mdpi/
. If this device happens to be an -xhdpi
device, then that would explain the memory usage, as Android will try to upsample this image and double each of the dimensions../ SOV
Posting Komentar