new Texture optimalization

Started by Thomas., February 22, 2011, 12:41:03 AM

Previous topic - Next topic

Thomas.

Is possible to do some optimalization in this command? As you can see garbage collector takes much time...
Texture tex = new Texture(width, height);

02-22 00:36:36.684: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 31ms
02-22 00:36:36.752: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 73 objects / 1575680 bytes in 31ms
02-22 00:36:36.816: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 63 objects / 1575200 bytes in 29ms
02-22 00:36:36.844: DEBUG/dalvikvm(10139): GC_EXPLICIT freed 166 objects / 137664 bytes in 578ms
02-22 00:36:36.880: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 52 objects / 1574848 bytes in 31ms
02-22 00:36:36.940: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 63 objects / 1575200 bytes in 30ms
02-22 00:36:37.000: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 52 objects / 1574848 bytes in 30ms
02-22 00:36:37.062: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 63 objects / 1575200 bytes in 31ms
02-22 00:36:37.122: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 52 objects / 1574848 bytes in 29ms
02-22 00:36:37.182: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 63 objects / 1575200 bytes in 30ms
02-22 00:36:37.242: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 52 objects / 1574848 bytes in 31ms
02-22 00:36:37.314: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 79 objects / 1575872 bytes in 36ms
02-22 00:36:37.394: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 104 objects / 1577024 bytes in 34ms
02-22 00:36:37.474: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 119 objects / 1577504 bytes in 32ms
02-22 00:36:37.554: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 107 objects / 1577120 bytes in 36ms
02-22 00:36:37.630: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 120 objects / 1577536 bytes in 35ms
02-22 00:36:37.710: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 106 objects / 1577088 bytes in 33ms
02-22 00:36:37.788: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 120 objects / 1577536 bytes in 34ms
02-22 00:36:37.866: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 106 objects / 1577088 bytes in 35ms
02-22 00:36:37.944: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 119 objects / 1577504 bytes in 35ms
02-22 00:36:38.018: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 91 objects / 1576432 bytes in 33ms
02-22 00:36:38.094: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 115 objects / 1577376 bytes in 34ms
02-22 00:36:38.162: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 95 objects / 1576560 bytes in 32ms
02-22 00:36:38.230: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 79 objects / 1575872 bytes in 32ms
02-22 00:36:38.296: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 73 objects / 1575680 bytes in 32ms
02-22 00:36:38.360: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 64 objects / 1575232 bytes in 31ms
02-22 00:36:38.430: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 68 objects / 1575520 bytes in 33ms
02-22 00:36:38.506: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 114 objects / 1577344 bytes in 34ms
02-22 00:36:38.588: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 110 objects / 1577216 bytes in 34ms
02-22 00:36:38.680: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 116 objects / 1577408 bytes in 32ms
02-22 00:36:38.774: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 110 objects / 1577216 bytes in 33ms
02-22 00:36:38.876: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 131 objects / 1578064 bytes in 35ms
02-22 00:36:38.976: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 132 objects / 1578096 bytes in 32ms
02-22 00:36:39.054: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 100 objects / 1576720 bytes in 33ms
02-22 00:36:39.124: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 90 objects / 1576400 bytes in 34ms
02-22 00:36:39.196: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 99 objects / 1576688 bytes in 33ms
02-22 00:36:39.262: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 90 objects / 1576400 bytes in 31ms
02-22 00:36:39.328: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 84 objects / 1576032 bytes in 29ms
02-22 00:36:39.388: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:39.454: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 78 objects / 1575840 bytes in 29ms
02-22 00:36:39.512: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 30ms
02-22 00:36:39.572: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 32ms
02-22 00:36:39.632: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 57 objects / 1575008 bytes in 29ms
02-22 00:36:39.692: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 30ms
02-22 00:36:39.750: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 57 objects / 1575008 bytes in 31ms
02-22 00:36:39.810: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 30ms
02-22 00:36:39.870: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 57 objects / 1575008 bytes in 30ms
02-22 00:36:39.932: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 34ms
02-22 00:36:39.996: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 72 objects / 1575648 bytes in 30ms
02-22 00:36:40.060: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 79 objects / 1575872 bytes in 30ms
02-22 00:36:40.120: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 30ms
02-22 00:36:40.180: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 58 objects / 1575040 bytes in 32ms
02-22 00:36:40.242: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 57 objects / 1575008 bytes in 32ms
02-22 00:36:40.306: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 73 objects / 1575680 bytes in 32ms
02-22 00:36:40.368: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 63 objects / 1575200 bytes in 32ms
02-22 00:36:40.428: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:40.488: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:40.546: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 29ms
02-22 00:36:40.606: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 30ms
02-22 00:36:40.666: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:40.726: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 29ms
02-22 00:36:40.786: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:40.846: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:40.906: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 29ms
02-22 00:36:40.964: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 30ms
02-22 00:36:41.026: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:41.084: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 29ms
02-22 00:36:41.144: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:41.204: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:41.264: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 29ms
02-22 00:36:41.326: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 29ms
02-22 00:36:41.392: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 33ms
02-22 00:36:41.454: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 35ms
02-22 00:36:41.518: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 35ms
02-22 00:36:41.578: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:41.642: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 33ms
02-22 00:36:41.704: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 33ms
02-22 00:36:41.766: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:41.830: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 34ms
02-22 00:36:41.892: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 33ms
02-22 00:36:41.944: DEBUG/dalvikvm(10149): GC_EXPLICIT freed 463 objects / 24752 bytes in 675ms
02-22 00:36:41.954: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 33ms
02-22 00:36:42.014: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:42.072: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:42.132: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:42.192: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 33ms
02-22 00:36:42.252: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:42.312: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:42.372: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 33ms
02-22 00:36:42.432: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:42.494: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 33ms
02-22 00:36:42.552: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:42.612: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:42.672: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:42.730: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:42.790: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:42.850: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:42.910: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:42.970: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:43.030: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:43.090: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:43.148: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 30ms
02-22 00:36:43.208: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:43.268: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:43.328: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:43.390: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 33ms
02-22 00:36:43.450: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:43.508: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 30ms
02-22 00:36:43.568: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:43.628: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:43.688: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:43.746: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:43.806: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:43.866: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:43.926: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:43.986: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:44.044: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 30ms
02-22 00:36:44.106: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:44.166: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:44.224: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:44.284: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:44.344: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 32ms
02-22 00:36:44.404: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:44.464: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:44.524: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 32ms
02-22 00:36:44.582: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 31ms
02-22 00:36:44.642: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms
02-22 00:36:44.702: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 62 objects / 1575168 bytes in 33ms
02-22 00:36:44.762: DEBUG/dalvikvm(10373): GC_FOR_MALLOC freed 53 objects / 1574880 bytes in 31ms

EgonOlsen

#1
Using the constructor should create no garbage at all...it's more likely the uploading to the GPU or something. Not much that i can in this area though.

BTW: How often are you doing this? Constantly creating textures at runtime isn't a very good idea performance wise (let along the GC issue).

Thomas.

#2
this is just example how expensive it is... ok i will be often trying to avoid creating new texture

EgonOlsen

I see. As said, uploading creates some garbage but that's unavoidable.