Katherine99
Katherine99

Reputation: 990

GC_Concurrent Freed and Android memory

I have an app which consists of loading some images one by one always ( not together) . Everytime I load a new image, the message of the Garbage Collector appears, as I understand the device is doing too much work. What could I do to solve this problem? I understand that if this problem continues the app will eventually crashing.

Messages like this one: GC_CONCURRENT freed 704K, 15% free 12439K/14471K, paused 13ms+13ms, total 69ms

Here is the method I use: I load the images in the array

public static Integer[] EnunciadoLogico = {
        R.drawable.i1,
        R.drawable.i2,
        R.drawable.i3,
        R.drawable.i4,
        R.drawable.i5,
        R.drawable.i6,
        R.drawable.i7,
        R.drawable.i8,
        R.drawable.i9,
        R.drawable.i10,
        R.drawable.i11,
        R.drawable.i12,
        R.drawable.i13,
        R.drawable.i14,
        R.drawable.i15,
        R.drawable.i16,
        R.drawable.i17,
        R.drawable.i18,
        R.drawable.i19,
        R.drawable.i20,
        R.drawable.i21,
        R.drawable.i22,
        R.drawable.i23,
        R.drawable.i24,
        R.drawable.i25,
        R.drawable.i26,
        R.drawable.i27,
        R.drawable.i28,
        R.drawable.i29,
        R.drawable.i30,};

Then I set the imageresource for the imageview, the user goes forward and backwards and one or another image is loaded in the imageview.

        ImagenEnun.setImageResource(EnunciadoLogico[posicion]);

Is there a better method to do this? Is this the reason of GC_CONCURRENT?

Thank you

Upvotes: 1

Views: 2374

Answers (1)

Related Questions