Android's Garbage Collector appear when trying

2019-09-14 19:41发布

问题:

My app renders 3D models via opengl ES2, once at a time. When I enable textures in those model my app crashes. First, I thought that was because the texture images are large, but the truth is that they are not. For instance, in one of the models, I use four .png images of sizes 4kb, 38kb, 39kb, and 200kb respectively. Are they large? I don't think so, but reading the logcat it seems that everything comes from a memory problem:

08-26 02:08:13.574: I/art(10870): Background sticky concurrent mark sweep GC freed 1557(49KB) AllocSpace objects, 22(8MB) LOS objects, 35% free, 13MB/21MB, paused 311us total 112.465ms

I am new on this and this message unfortunately doesn't say anything to me. Reading out there it seems that the Garbage Collector decided to appear, but I don't know the reason. Somebody can tell me what could be the issue, or give me some hint about how to attack this kind of situation?

Thank you in advance,

JM

PS: I am using a Nexus 5x and Samsung Galaxy TAB A as testing's devices