Not compressing them reduces the memory peak when uncompressing them...it might help to avoid the problem, but i still don't get it...
this is the output of Galaxy Nexus:
03-20 10:04:09.402: I/jPCT-AE(9169): Allocating native memory for 1024*1024 texture(true/false/true/false/): 4194304 bytes!
03-20 10:04:09.426: D/dalvikvm(9169): GC_FOR_ALLOC freed <1K, 32% free 31791K/46151K, paused 21ms
03-20 10:04:09.434: I/dalvikvm-heap(9169): Grow heap (frag case) to 35.088MB for 4194320-byte allocation
...and this is the one from the Tegra:
03-20 09:40:03.690: I/jPCT-AE(13841): Allocating native memory for 1024*1024 texture(true/false/true/false/): 4194304 bytes!
03-20 09:40:03.720: D/dalvikvm(13841): GC_CONCURRENT freed <1K, 20% free 26640K/33031K, paused 3ms+3ms
03-20 09:40:03.760: D/dalvikvm(13841): GC_FOR_ALLOC freed 8434K, 45% free 18205K/33031K, paused 36ms
03-20 09:40:03.790: I/dalvikvm-heap(13841): Grow heap (frag case) to 33.886MB for 16777232-byte allocation
And THIS is the code:
if (Logger.isDebugEnabled()) {
Logger.log("Allocating native memory for " + w + "*" + h + " texture(" + tex.bilinear + "/" + tex.etc1 + "/" + (tex.zippedTexels != null) + "/" + tex.isUnicolor + "/" + "): " + len + " bytes!", Logger.DEBUG);
}
temp = ByteBuffer.allocateDirect(len).order(ByteOrder.LITTLE_ENDIAN);
And now please tell me: How can this code lead to a 16mb allocation on the Tegra (which is bullshit) but to 4mb allocation (which is correct) on everything else!? Maybe a bug in that version of the SDK?