Is this normal GC behaviour from support.map.fragment? - android
I'm having some issues understanding the GC, and Maps V2. On Zoom (in / out) the GC kicks in constantly cleaning up, making the application hang for half a second in the mapview.
If I remove the mapview from the application everything runs fine, but as soon as I add the mapview GC kicks brutal in (On create, and on zoom in /out).
I'm using the supportv4.support.map.fragment. I dont know if I should include layout and code? As this is many classes, and a whole lot of code for a general question.
Would you say this is my fault / Most likely implemented maps wrong? Or caused a memory leak?
Or is this normal behavior? I run the app on my Xperia Z, and it works "ok", but if I try it on my S2 it's a nightmare.
A print of my Logcat going wild :
08-18 00:57:27.759: D/dalvikvm(12809): GC_FOR_ALLOC freed 4796K, 61% free 21315K/54640K, paused 34ms, total 35ms
08-18 00:57:29.681: D/dalvikvm(12809): GC_CONCURRENT freed 5994K, 61% free 21580K/54640K, paused 5ms+5ms, total 53ms
08-18 00:57:29.681: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 36ms
08-18 00:57:32.433: D/dalvikvm(12809): GC_FOR_ALLOC freed 3498K, 61% free 21699K/54640K, paused 67ms, total 67ms
08-18 00:57:32.804: D/dalvikvm(12809): GC_FOR_ALLOC freed 4774K, 61% free 21723K/54640K, paused 33ms, total 34ms
08-18 00:57:32.904: D/dalvikvm(12809): GC_FOR_ALLOC freed 5096K, 62% free 20916K/54640K, paused 31ms, total 32ms
08-18 00:57:33.224: D/dalvikvm(12809): GC_FOR_ALLOC freed 5296K, 62% free 20997K/54640K, paused 32ms, total 33ms
08-18 00:57:33.344: D/dalvikvm(12809): GC_FOR_ALLOC freed 5301K, 62% free 21083K/54640K, paused 30ms, total 31ms
08-18 00:57:33.454: D/dalvikvm(12809): GC_FOR_ALLOC freed 5397K, 63% free 20667K/54640K, paused 35ms, total 36ms
08-18 00:57:33.725: D/dalvikvm(12809): GC_CONCURRENT freed 4481K, 60% free 22222K/54640K, paused 3ms+5ms, total 37ms
08-18 00:57:33.825: D/dalvikvm(12809): GC_FOR_ALLOC freed 6110K, 61% free 21595K/54640K, paused 42ms, total 42ms
08-18 00:57:33.915: D/dalvikvm(12809): GC_CONCURRENT freed 5407K, 59% free 22492K/54640K, paused 3ms+5ms, total 38ms
08-18 00:57:33.915: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 26ms
08-18 00:57:33.915: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 29ms
08-18 00:57:33.995: D/dalvikvm(12809): GC_FOR_ALLOC freed 4654K, 60% free 22322K/54640K, paused 31ms, total 31ms
08-18 00:57:34.155: D/dalvikvm(12809): GC_CONCURRENT freed 5992K, 59% free 22815K/54640K, paused 3ms+4ms, total 34ms
08-18 00:57:34.155: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 28ms
08-18 00:57:34.155: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 26ms
08-18 00:57:34.275: D/dalvikvm(12809): GC_FOR_ALLOC freed 5334K, 58% free 23396K/54640K, paused 33ms, total 40ms
08-18 00:57:34.415: D/dalvikvm(12809): GC_FOR_ALLOC freed 5573K, 58% free 23322K/54640K, paused 45ms, total 45ms
08-18 00:57:34.505: D/dalvikvm(12809): GC_FOR_ALLOC freed 4165K, 58% free 23277K/54640K, paused 33ms, total 33ms
08-18 00:57:34.636: D/dalvikvm(12809): GC_FOR_ALLOC freed 4192K, 58% free 23238K/54640K, paused 41ms, total 42ms
08-18 00:57:34.736: D/dalvikvm(12809): GC_FOR_ALLOC freed 4138K, 58% free 23217K/54640K, paused 37ms, total 37ms
08-18 00:57:34.886: D/dalvikvm(12809): GC_FOR_ALLOC freed 5108K, 56% free 24575K/54640K, paused 46ms, total 46ms
08-18 00:57:35.026: D/dalvikvm(12809): GC_FOR_ALLOC freed 6540K, 56% free 24073K/54640K, paused 51ms, total 52ms
08-18 00:57:35.156: D/dalvikvm(12809): GC_FOR_ALLOC freed 4840K, 55% free 24738K/54640K, paused 31ms, total 31ms
08-18 00:57:35.356: D/dalvikvm(12809): GC_FOR_ALLOC freed 4325K, 55% free 24635K/54640K, paused 38ms, total 38ms
08-18 00:57:35.436: D/dalvikvm(12809): GC_FOR_ALLOC freed 4122K, 55% free 24632K/54640K, paused 35ms, total 35ms
08-18 00:57:35.526: D/dalvikvm(12809): GC_FOR_ALLOC freed 4722K, 57% free 24029K/54640K, paused 34ms, total 34ms
08-18 00:57:35.597: D/dalvikvm(12809): GC_FOR_ALLOC freed 4233K, 57% free 23916K/54640K, paused 32ms, total 32ms
08-18 00:57:36.027: D/dalvikvm(12809): GC_FOR_ALLOC freed 4581K, 57% free 23750K/54640K, paused 34ms, total 35ms
08-18 00:57:36.117: D/dalvikvm(12809): GC_FOR_ALLOC freed 4297K, 57% free 23573K/54640K, paused 32ms, total 33ms
08-18 00:57:36.207: D/dalvikvm(12809): GC_FOR_ALLOC freed 4223K, 58% free 23467K/54640K, paused 31ms, total 32ms
08-18 00:57:36.277: D/dalvikvm(12809): GC_FOR_ALLOC freed 4184K, 58% free 23399K/54640K, paused 31ms, total 31ms
08-18 00:57:36.357: D/dalvikvm(12809): GC_FOR_ALLOC freed 4209K, 58% free 23305K/54640K, paused 31ms, total 31ms
08-18 00:57:36.447: D/dalvikvm(12809): GC_FOR_ALLOC freed 4252K, 58% free 23173K/54640K, paused 35ms, total 35ms
08-18 00:57:36.988: D/dalvikvm(12809): GC_FOR_ALLOC freed 4669K, 58% free 23038K/54640K, paused 35ms, total 36ms
08-18 00:57:37.508: D/dalvikvm(12809): GC_FOR_ALLOC freed 4589K, 59% free 22919K/54640K, paused 54ms, total 55ms
08-18 00:57:38.940: D/dalvikvm(12809): GC_CONCURRENT freed 6052K, 57% free 23609K/54640K, paused 3ms+6ms, total 71ms
08-18 00:57:38.940: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 41ms
08-18 00:57:38.940: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 26ms
08-18 00:57:39.250: D/dalvikvm(12809): GC_FOR_ALLOC freed 6227K, 58% free 23000K/54640K, paused 33ms, total 34ms
08-18 00:57:40.501: D/dalvikvm(12809): GC_CONCURRENT freed 6455K, 58% free 23360K/54640K, paused 3ms+4ms, total 77ms
08-18 00:57:40.501: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 57ms
08-18 00:57:40.822: D/dalvikvm(12809): GC_CONCURRENT freed 7158K, 58% free 23100K/54640K, paused 2ms+5ms, total 38ms
08-18 00:57:40.822: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 23ms
08-18 00:57:41.022: D/dalvikvm(12809): GC_FOR_ALLOC freed 2905K, 57% free 23771K/54640K, paused 37ms, total 38ms
08-18 00:57:41.122: D/dalvikvm(12809): GC_CONCURRENT freed 6499K, 56% free 24292K/54640K, paused 7ms+6ms, total 44ms
08-18 00:57:41.122: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 36ms
08-18 00:57:41.232: D/dalvikvm(12809): GC_FOR_ALLOC freed 5791K, 57% free 23732K/54640K, paused 32ms, total 32ms
08-18 00:57:41.322: D/dalvikvm(12809): GC_FOR_ALLOC freed 4391K, 57% free 23723K/54640K, paused 34ms, total 34ms
08-18 00:57:41.402: D/dalvikvm(12809): GC_FOR_ALLOC freed 4853K, 58% free 22986K/54640K, paused 36ms, total 36ms
08-18 00:57:41.472: D/dalvikvm(12809): GC_FOR_ALLOC freed 4111K, 58% free 22975K/54640K, paused 30ms, total 31ms
08-18 00:57:41.602: D/dalvikvm(12809): GC_CONCURRENT freed 6093K, 57% free 23652K/54640K, paused 3ms+6ms, total 46ms
08-18 00:57:41.602: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 27ms
08-18 00:57:41.602: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 4ms
08-18 00:57:41.702: D/dalvikvm(12809): GC_FOR_ALLOC freed 5077K, 57% free 23645K/54640K, paused 34ms, total 34ms
08-18 00:57:41.783: D/dalvikvm(12809): GC_FOR_ALLOC freed 4265K, 57% free 23495K/54640K, paused 36ms, total 36ms
08-18 00:57:41.993: D/dalvikvm(12809): GC_FOR_ALLOC freed 4500K, 58% free 23113K/54640K, paused 81ms, total 81ms
08-18 00:57:42.083: D/dalvikvm(12809): GC_FOR_ALLOC freed 4842K, 60% free 22385K/54640K, paused 32ms, total 32ms
08-18 00:57:42.824: D/dalvikvm(12809): GC_FOR_ALLOC freed 4872K, 60% free 22271K/54640K, paused 41ms, total 41ms
08-18 00:57:42.934: D/dalvikvm(12809): GC_FOR_ALLOC freed 4732K, 60% free 22288K/54640K, paused 50ms, total 50ms
08-18 00:57:49.941: D/dalvikvm(12809): GC_FOR_ALLOC freed 5747K, 62% free 21152K/54640K, paused 36ms, total 36ms
08-18 00:57:50.081: D/dalvikvm(12809): GC_FOR_ALLOC freed 4324K, 62% free 20956K/54640K, paused 36ms, total 36ms
08-18 00:57:50.221: D/dalvikvm(12809): GC_FOR_ALLOC freed 4134K, 62% free 20925K/54640K, paused 34ms, total 34ms
08-18 00:57:52.193: D/dalvikvm(12809): GC_CONCURRENT freed 5892K, 62% free 21133K/54640K, paused 4ms+8ms, total 51ms
08-18 00:57:52.193: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 33ms
08-18 00:57:52.283: D/dalvikvm(12809): GC_FOR_ALLOC freed 1769K, 60% free 22065K/54640K, paused 38ms, total 38ms
08-18 00:57:52.353: D/dalvikvm(12809): GC_FOR_ALLOC freed 4917K, 61% free 21594K/54640K, paused 31ms, total 32ms
08-18 00:57:52.443: D/dalvikvm(12809): GC_FOR_ALLOC freed 5029K, 63% free 20683K/54640K, paused 31ms, total 31ms
08-18 00:57:52.523: D/dalvikvm(12809): GC_FOR_ALLOC freed 4289K, 63% free 20512K/54640K, paused 32ms, total 32ms
08-18 00:57:52.603: D/dalvikvm(12809): GC_FOR_ALLOC freed 4141K, 63% free 20486K/54640K, paused 32ms, total 32ms
08-18 00:57:52.723: D/dalvikvm(12809): GC_FOR_ALLOC freed 4425K, 62% free 20829K/54640K, paused 29ms, total 30ms
08-18 00:57:53.064: D/dalvikvm(12809): GC_FOR_ALLOC freed 5106K, 62% free 20810K/54640K, paused 40ms, total 41ms
08-18 00:57:56.347: D/dalvikvm(12809): GC_CONCURRENT freed 6009K, 62% free 20820K/54640K, paused 4ms+5ms, total 80ms
08-18 00:57:56.497: D/dalvikvm(12809): GC_FOR_ALLOC freed 2729K, 62% free 20880K/54640K, paused 32ms, total 32ms
08-18 00:57:56.597: D/dalvikvm(12809): GC_FOR_ALLOC freed 4888K, 63% free 20374K/54640K, paused 34ms, total 34ms
08-18 00:57:56.937: D/dalvikvm(12809): GC_FOR_ALLOC freed 5928K, 64% free 20162K/54640K, paused 32ms, total 32ms
08-18 00:57:57.077: D/dalvikvm(12809): GC_CONCURRENT freed 4630K, 61% free 21408K/54640K, paused 3ms+4ms, total 37ms
08-18 00:57:57.077: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 30ms
08-18 00:57:57.077: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 31ms
08-18 00:57:57.077: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 30ms
08-18 00:57:57.238: D/dalvikvm(12809): GC_FOR_ALLOC freed 6073K, 62% free 20893K/54640K, paused 32ms, total 32ms
08-18 00:57:57.318: D/dalvikvm(12809): GC_FOR_ALLOC freed 4142K, 62% free 20868K/54640K, paused 31ms, total 31ms
08-18 00:57:57.818: D/dalvikvm(12809): GC_FOR_ALLOC freed 4675K, 62% free 20893K/54640K, paused 34ms, total 35ms
08-18 00:57:57.898: D/dalvikvm(12809): GC_FOR_ALLOC freed 4127K, 62% free 20884K/54640K, paused 30ms, total 31ms
08-18 00:57:57.968: D/dalvikvm(12809): GC_FOR_ALLOC freed 4208K, 62% free 20798K/54640K, paused 30ms, total 30ms
08-18 00:57:58.179: D/dalvikvm(12809): GC_FOR_ALLOC freed 5894K, 63% free 20313K/54640K, paused 30ms, total 30ms
08-18 00:57:58.919: D/dalvikvm(12809): GC_CONCURRENT freed 5791K, 63% free 20421K/54640K, paused 2ms+4ms, total 40ms
08-18 00:57:58.919: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 35ms
08-18 00:57:59.079: D/dalvikvm(12809): GC_FOR_ALLOC freed 5360K, 63% free 20334K/54640K, paused 33ms, total 34ms
08-18 00:57:59.300: D/dalvikvm(12809): GC_CONCURRENT freed 5742K, 63% free 20509K/54640K, paused 3ms+14ms, total 119ms
08-18 00:57:59.310: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 12ms
08-18 00:57:59.690: D/dalvikvm(12809): GC_FOR_ALLOC freed 2021K, 61% free 21445K/54640K, paused 42ms, total 44ms
08-18 00:57:59.830: D/dalvikvm(12809): GC_FOR_ALLOC freed 5660K, 60% free 21941K/54640K, paused 42ms, total 42ms
08-18 00:57:59.930: D/dalvikvm(12809): GC_FOR_ALLOC freed 5045K, 60% free 22231K/54640K, paused 32ms, total 32ms
08-18 00:58:00.040: D/dalvikvm(12809): GC_FOR_ALLOC freed 4584K, 60% free 22140K/54640K, paused 54ms, total 54ms
08-18 00:58:00.130: D/dalvikvm(12809): GC_FOR_ALLOC freed 4670K, 61% free 21591K/54640K, paused 34ms, total 35ms
08-18 00:58:00.221: D/dalvikvm(12809): GC_FOR_ALLOC freed 4148K, 61% free 21562K/54640K, paused 30ms, total 30ms
08-18 00:58:00.321: D/dalvikvm(12809): GC_FOR_ALLOC freed 4164K, 61% free 21519K/54640K, paused 30ms, total 30ms
08-18 00:58:00.401: D/dalvikvm(12809): GC_FOR_ALLOC freed 4217K, 61% free 21417K/54640K, paused 29ms, total 29ms
08-18 00:58:00.471: D/dalvikvm(12809): GC_FOR_ALLOC freed 4105K, 61% free 21416K/54640K, paused 27ms, total 27ms
08-18 00:58:00.611: D/dalvikvm(12809): GC_FOR_ALLOC freed 4794K, 61% free 21371K/54640K, paused 33ms, total 34ms
08-18 00:58:00.681: D/dalvikvm(12809): GC_FOR_ALLOC freed 4107K, 61% free 21370K/54640K, paused 29ms, total 30ms
08-18 00:58:02.393: D/dalvikvm(12809): GC_FOR_ALLOC freed 5465K, 61% free 21435K/54640K, paused 33ms, total 33ms
08-18 00:58:02.523: D/dalvikvm(12809): GC_FOR_ALLOC freed 4571K, 59% free 22563K/54640K, paused 31ms, total 31ms
08-18 00:58:03.614: D/dalvikvm(12809): GC_FOR_ALLOC freed 6525K, 61% free 21447K/54640K, paused 39ms, total 39ms
08-18 00:58:03.724: D/dalvikvm(12809): GC_FOR_ALLOC freed 4316K, 61% free 21581K/54640K, paused 42ms, total 42ms
08-18 00:58:05.015: D/dalvikvm(12809): GC_CONCURRENT freed 5834K, 60% free 21992K/54640K, paused 3ms+6ms, total 43ms
08-18 00:58:06.056: D/dalvikvm(12809): GC_CONCURRENT freed 6081K, 60% free 22291K/54640K, paused 3ms+7ms, total 43ms
08-18 00:58:06.056: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 29ms
08-18 00:58:06.677: D/dalvikvm(12809): JIT code cache reset in 1 ms (1048524 bytes 2/0)
08-18 00:58:06.687: D/dalvikvm(12809): GC_CONCURRENT freed 7111K, 61% free 21744K/54640K, paused 3ms+7ms, total 55ms
08-18 00:58:06.687: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 19ms
08-18 00:58:08.278: D/dalvikvm(12809): GC_FOR_ALLOC freed 4619K, 60% free 22283K/54640K, paused 45ms, total 45ms
08-18 00:58:08.389: D/dalvikvm(12809): GC_FOR_ALLOC freed 5813K, 59% free 22471K/54640K, paused 33ms, total 33ms
08-18 00:58:08.469: D/dalvikvm(12809): GC_FOR_ALLOC freed 4225K, 60% free 22366K/54640K, paused 31ms, total 31ms
08-18 00:58:08.549: D/dalvikvm(12809): GC_FOR_ALLOC freed 4363K, 60% free 22122K/54640K, paused 32ms, total 32ms
08-18 00:58:08.789: D/dalvikvm(12809): GC_FOR_ALLOC freed 5598K, 60% free 21959K/54640K, paused 33ms, total 33ms
08-18 00:58:08.869: D/dalvikvm(12809): GC_FOR_ALLOC freed 4264K, 61% free 21812K/54640K, paused 31ms, total 32ms
08-18 00:58:08.949: D/dalvikvm(12809): GC_FOR_ALLOC freed 4332K, 61% free 21595K/54640K, paused 30ms, total 30ms
08-18 00:58:09.019: D/dalvikvm(12809): GC_FOR_ALLOC freed 4344K, 61% free 21371K/54640K, paused 29ms, total 29ms
08-18 00:58:09.109: D/dalvikvm(12809): GC_FOR_ALLOC freed 4273K, 62% free 21234K/54640K, paused 29ms, total 30ms
08-18 00:58:09.349: D/dalvikvm(12809): GC_FOR_ALLOC freed 5486K, 61% free 21376K/54640K, paused 30ms, total 30ms
08-18 00:58:09.450: D/dalvikvm(12809): GC_FOR_ALLOC freed 4512K, 61% free 21369K/54640K, paused 30ms, total 31ms
08-18 00:58:10.270: D/dalvikvm(12809): GC_FOR_ALLOC freed 4973K, 61% free 21620K/54640K, paused 32ms, total 33ms
08-18 00:58:10.370: D/dalvikvm(12809): GC_FOR_ALLOC freed 4236K, 61% free 21641K/54640K, paused 34ms, total 34ms
08-18 00:58:10.471: D/dalvikvm(12809): GC_FOR_ALLOC freed 4620K, 61% free 21365K/54640K, paused 32ms, total 32ms
08-18 00:58:10.541: D/dalvikvm(12809): GC_FOR_ALLOC freed 4108K, 61% free 21365K/54640K, paused 30ms, total 30ms
08-18 00:58:12.232: D/dalvikvm(12809): GC_FOR_ALLOC freed 5405K, 61% free 21615K/54640K, paused 35ms, total 35ms
08-18 00:58:12.382: D/dalvikvm(12809): GC_CONCURRENT freed 5083K, 59% free 22860K/54640K, paused 4ms+5ms, total 40ms
08-18 00:58:12.382: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 31ms
08-18 00:58:12.382: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 2ms
08-18 00:58:12.472: D/dalvikvm(12809): GC_FOR_ALLOC freed 4242K, 59% free 22790K/54640K, paused 31ms, total 31ms
08-18 00:58:12.553: D/dalvikvm(12809): GC_FOR_ALLOC freed 4204K, 59% free 22702K/54640K, paused 32ms, total 32ms
08-18 00:58:13.113: D/dalvikvm(12809): GC_FOR_ALLOC freed 5858K, 59% free 22847K/54640K, paused 37ms, total 38ms
08-18 00:58:13.223: D/dalvikvm(12809): GC_FOR_ALLOC freed 4548K, 59% free 22712K/54640K, paused 33ms, total 33ms
08-18 00:58:13.323: D/dalvikvm(12809): GC_FOR_ALLOC freed 4339K, 59% free 22625K/54640K, paused 30ms, total 31ms
08-18 00:58:13.413: D/dalvikvm(12809): GC_FOR_ALLOC freed 5406K, 61% free 21599K/54640K, paused 30ms, total 31ms
08-18 00:58:13.604: D/dalvikvm(12809): GC_CONCURRENT freed 6158K, 61% free 21733K/54640K, paused 2ms+4ms, total 38ms
08-18 00:58:13.614: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 32ms
08-18 00:58:15.005: D/dalvikvm(12809): GC_FOR_ALLOC freed 4289K, 59% free 22877K/54640K, paused 35ms, total 35ms
08-18 00:58:15.095: D/dalvikvm(12809): GC_FOR_ALLOC freed 4504K, 59% free 22520K/54640K, paused 31ms, total 31ms
08-18 00:58:15.175: D/dalvikvm(12809): GC_FOR_ALLOC freed 4684K, 60% free 21950K/54640K, paused 30ms, total 30ms
08-18 00:58:15.245: D/dalvikvm(12809): GC_FOR_ALLOC freed 4162K, 60% free 21904K/54640K, paused 29ms, total 30ms
08-18 00:58:16.176: D/dalvikvm(12809): GC_CONCURRENT freed 5225K, 58% free 23043K/54640K, paused 3ms+7ms, total 64ms
08-18 00:58:16.276: D/dalvikvm(12809): GC_FOR_ALLOC freed 4773K, 57% free 23539K/54640K, paused 33ms, total 33ms
08-18 00:58:16.376: D/dalvikvm(12809): GC_FOR_ALLOC freed 4421K, 57% free 23510K/54640K, paused 31ms, total 32ms
08-18 00:58:16.456: D/dalvikvm(12809): GC_FOR_ALLOC freed 4215K, 58% free 23474K/54640K, paused 30ms, total 30ms
08-18 00:58:16.827: D/dalvikvm(12809): GC_FOR_ALLOC freed 5377K, 59% free 22494K/54640K, paused 38ms, total 39ms
08-18 00:58:16.917: D/dalvikvm(12809): GC_FOR_ALLOC freed 4138K, 59% free 22476K/54640K, paused 31ms, total 32ms
08-18 00:58:16.987: D/dalvikvm(12809): GC_FOR_ALLOC freed 4263K, 60% free 22324K/54640K, paused 30ms, total 31ms
08-18 00:58:18.909: D/dalvikvm(12809): GC_FOR_ALLOC freed 5483K, 60% free 22387K/54640K, paused 33ms, total 34ms
08-18 00:58:19.009: D/dalvikvm(12809): GC_FOR_ALLOC freed 4107K, 60% free 22382K/54640K, paused 39ms, total 39ms
08-18 00:58:19.119: D/dalvikvm(12809): GC_FOR_ALLOC freed 4455K, 60% free 22348K/54640K, paused 35ms, total 35ms
08-18 00:58:21.902: D/dalvikvm(12809): GC_FOR_ALLOC freed 7009K, 61% free 21810K/54640K, paused 38ms, total 38ms
08-18 00:58:22.112: D/dalvikvm(12809): GC_CONCURRENT freed 5015K, 58% free 23221K/54640K, paused 3ms+4ms, total 38ms
08-18 00:58:22.112: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 28ms
08-18 00:58:22.112: D/dalvikvm(12809): WAIT_FOR_CONCURRENT_GC blocked 30ms
08-18 00:58:22.232: D/dalvikvm(12809): GC_FOR_ALLOC freed 5467K, 60% free 22264K/54640K, paused 30ms, total 30ms
08-18 00:58:22.302: D/dalvikvm(12809): GC_FOR_ALLOC freed 4119K, 60% free 22264K/54640K, paused 31ms, total 31ms
08-18 00:58:22.372: D/dalvikvm(12809): GC_FOR_ALLOC freed 4100K, 60% free 22263K/54640K, paused 30ms, total 30ms
Related
My Application freezes
I am developing an android application for fingerprint reader, my operations include verifying user fingerprint(continuously), and registering new fingerprints(getting fingerprints from web API). I am using Morpho MSO 1300 fingerprint reader. when I run my application I am constantly getting following logcat messages 01-02 11:19:48.910 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:49.350 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:49.770 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:50.210 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:50.630 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:51.070 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:51.570 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:52.070 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:52.570 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:53.000 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:53.500 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:53.930 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:54.360 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:54.800 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3633K/4540K, paused 14ms, total 14ms 01-02 11:19:55.300 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 336K, 20% free 3652K/4540K, paused 14ms, total 14ms 01-02 11:19:55.730 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 301K, 20% free 3644K/4540K, paused 14ms, total 14ms 01-02 11:19:56.150 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3644K/4540K, paused 15ms, total 15ms 01-02 11:19:56.600 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3644K/4540K, paused 14ms, total 14ms 01-02 11:19:57.010 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3644K/4540K, paused 14ms, total 14ms 01-02 11:19:57.440 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 295K, 20% free 3644K/4540K, paused 14ms, total 14ms 01-02 11:19:57.880 5286-11417/com.cms.attendance D/dalvikvm: GC_FOR_ALLOC freed 293K, 20% free 3644K/4540K, paused 14ms, total 14ms 01-02 11:19:58.030 24732-24776/com.baidu.video.pad:download V/P2PBase: [11:19:58:040][P2PBase] dns : media.p2sp.baidu.com resolve failed. wait 3 As I increase data in my application, say I get 1000 users from web API and I try to process them and register them in fingerprint reader and sqlite database eventually my application freezes. Any help will be appreciated.
This log means that Garbage collector just released the memory. You are making a lot of allocations and this is the reason why GC have to work frequently. I recommend You to use Android Profiler (Android Studio 3.0) and try to overcome this problem: https://developer.android.com/studio/profile/memory-profiler.html or past your code so that we can think about it together.
Too many GC_FOR_ALLOC in logcat
while running logcat on my app's logs, I see lots of GC_FOR_ALLOCs and no GC_CONCURRENT messages. I know I have memory leak, but everywhere in stack and other sites, logcat messages has lots of GC_CONCURRENT messages, and few GC_FOR_ALLOC messages. I wanna know what am I doing wrong? Do I have any special case of memory leak in my app? what's the problem? BTW: I know Eclipse MAT and I'm trying to fix memory leak using MAT. I just don't know why GC_FOR_ALLOC is called so frequent. logcat: D/dalvikvm(18068): GC_FOR_ALLOC freed 3974K, 8% free 54640K/58964K, paused 42ms, total 42ms D/dalvikvm(18068): GC_FOR_ALLOC freed 473K, 8% free 54622K/58964K, paused 28ms, total 28ms D/dalvikvm(18068): GC_FOR_ALLOC freed 139K, 7% free 55010K/58964K, paused 19ms, total 20ms I/dalvikvm-heap(18068): Grow heap (frag case) to 54.623MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 122K, 7% free 55071K/59032K, paused 29ms, total 29ms I/dalvikvm-heap(18068): Grow heap (frag case) to 54.683MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 20K, 7% free 55172K/59100K, paused 20ms, total 20ms I/dalvikvm-heap(18068): Grow heap (frag case) to 54.781MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 310K, 7% free 55165K/59168K, paused 18ms, total 19ms I/dalvikvm-heap(18068): Grow heap (frag case) to 54.774MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 485K, 7% free 55165K/59236K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 54.774MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 245K, 7% free 55365K/59304K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 54.970MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 66K, 7% free 55424K/59372K, paused 28ms, total 28ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.027MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 104K, 7% free 55568K/59440K, paused 21ms, total 21ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.167MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 47K, 7% free 55676K/59508K, paused 30ms, total 30ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.274MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 26K, 7% free 55791K/59576K, paused 24ms, total 24ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.386MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 30K, 7% free 55923K/59644K, paused 21ms, total 21ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.515MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 22K, 7% free 56048K/59712K, paused 17ms, total 18ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.636MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 611K, 7% free 55975K/59780K, paused 23ms, total 24ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.566MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 279K, 7% free 55975K/59848K, paused 20ms, total 20ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.565MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 92K, 7% free 56051K/59916K, paused 30ms, total 30ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.639MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 351K, 7% free 56272K/59984K, paused 31ms, total 31ms D/dalvikvm(18068): GC_FOR_ALLOC freed 25K, 7% free 56269K/59984K, paused 30ms, total 30ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.853MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 105K, 7% free 56320K/60052K, paused 19ms, total 19ms I/dalvikvm-heap(18068): Grow heap (frag case) to 55.902MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 526K, 7% free 56369K/60120K, paused 20ms, total 20ms D/dalvikvm(18068): GC_FOR_ALLOC freed 934K, 7% free 56462K/60120K, paused 19ms, total 20ms I/dalvikvm-heap(18068): Grow heap (frag case) to 56.041MB for 65552-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 140K, 7% free 56510K/60188K, paused 34ms, total 34ms I/dalvikvm-heap(18068): Grow heap (frag case) to 56.765MB for 775824-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 30K, 6% free 57414K/60948K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 57.241MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 6K, 6% free 57749K/61292K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 57.569MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed <1K, 6% free 58091K/61636K, paused 18ms, total 18ms I/dalvikvm-heap(18068): Grow heap (frag case) to 57.902MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed <1K, 6% free 58433K/61980K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 58.236MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed <1K, 6% free 58774K/62324K, paused 26ms, total 27ms I/dalvikvm-heap(18068): Grow heap (frag case) to 58.569MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed <1K, 6% free 59116K/62668K, paused 21ms, total 22ms I/dalvikvm-heap(18068): Grow heap (frag case) to 58.903MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed <1K, 6% free 59457K/63012K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 59.236MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed <1K, 6% free 59799K/63356K, paused 17ms, total 17ms I/dalvikvm-heap(18068): Grow heap (frag case) to 59.570MB for 349072-byte allocation D/dalvikvm(18068): GC_FOR_ALLOC freed 301K, 6% free 60326K/63700K, paused 25ms, total 25ms D/dalvikvm(18068): GC_FOR_ALLOC freed 168K, 5% free 60826K/63952K, paused 18ms, total 18ms I/dalvikvm(18068): Jit: resizing JitTable from 4096 to 8192 D/dalvikvm(18068): GC_FOR_ALLOC freed 1166K, 5% free 61664K/64476K, paused 23ms, total 23ms D/dalvikvm(18068): GC_FOR_ALLOC freed 2061K, 5% free 62858K/65748K, paused 25ms, total 26ms D/dalvikvm(18068): GC_FOR_ALLOC freed 1867K, 4% free 64650K/67260K, paused 24ms, total 28ms D/dalvikvm(18068): GC_FOR_ALLOC freed 5784K, 9% free 63169K/69304K, paused 42ms, total 42ms D/dalvikvm(18068): GC_FOR_ALLOC freed 115K, 5% free 66326K/69304K, paused 22ms, total 24ms D/dalvikvm(18068): GC_FOR_ALLOC freed 6127K, 10% free 65352K/71840K, paused 53ms, total 53ms D/dalvikvm(18068): GC_FOR_ALLOC freed 257K, 5% free 68326K/71840K, paused 23ms, total 23ms D/dalvikvm(18068): GC_FOR_ALLOC freed 6537K, 10% free 67693K/74588K, paused 43ms, total 43ms D/dalvikvm(18068): GC_FOR_ALLOC freed 114K, 6% free 70847K/74588K, paused 22ms, total 22ms D/dalvikvm(18068): GC_FOR_ALLOC freed 1977K, 4% free 74341K/77420K, paused 38ms, total 38ms D/dalvikvm(18068): GC_FOR_ALLOC freed 2684K, 4% free 79560K/82616K, paused 48ms, total 48ms D/dalvikvm(18068): GC_FOR_ALLOC freed 5961K, 8% free 81482K/87804K, paused 57ms, total 62ms D/dalvikvm(18068): GC_FOR_ALLOC freed 3869K, 8% free 82684K/89868K, paused 50ms, total 50ms D/dalvikvm(18068): GC_FOR_ALLOC freed 2325K, 5% free 87087K/90900K, paused 31ms, total 31ms thanks
This may be a problem in Android's heap implementation: http://androidxref.com/4.4.4_r1/xref/dalvik/vm/alloc/Heap.cpp See comment in tryMalloc: There will be a lot of churn if someone allocates a bunch of big objects in a row, and we hit the frag case each time. A full GC for each.
Progress Dialog not spinning when device is performing memory cleaning
hii everyone i need to get 1200 records from db so i have written AsyncTask for retrevind data here is my code new AsyncTask<Integer, Integer, Integer>(){ #Override protected void onPreExecute() { pd=ProgressDialog.show(CasePersonScreen.this, "Please Wait", "Getting Case Persons"); pd.setIndeterminate(true); } #Override protected Integer doInBackground(Integer... params) { // **Code** performing database operations CasePersonArryList = objBLParentToChildCommonOperations.getCasePersons(objCase); return 1; } #Override protected void onPostExecute(Integer arg0) { if(pd!=null&&pd.isShowing()) { pd.dismiss(); } }.execute(1,1,1); Now progress bar started spinning and it got freezed when vm is performing gc activities 04-16 18:07:18.760: D/dalvikvm(5993): GC_CONCURRENT freed 2505K, 29% free 18917K/26439K, paused 1ms+7ms 04-16 18:07:19.015: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18917K/26439K, paused 2ms+4ms 04-16 18:07:19.170: D/dalvikvm(5993): GC_CONCURRENT freed 2031K, 29% free 18934K/26439K, paused 2ms+4ms 04-16 18:07:19.325: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18930K/26439K, paused 1ms+4ms 04-16 18:07:19.465: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18926K/26439K, paused 1ms+4ms 04-16 18:07:19.610: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18941K/26439K, paused 1ms+4ms 04-16 18:07:19.750: D/dalvikvm(5993): GC_CONCURRENT freed 2059K, 29% free 18929K/26439K, paused 1ms+4ms 04-16 18:07:19.895: D/dalvikvm(5993): GC_CONCURRENT freed 2046K, 29% free 18930K/26439K, paused 1ms+3ms 04-16 18:07:20.045: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18934K/26439K, paused 2ms+4ms 04-16 18:07:20.205: D/dalvikvm(5993): GC_CONCURRENT freed 2054K, 29% free 18927K/26439K, paused 2ms+3ms 04-16 18:07:20.370: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18941K/26439K, paused 2ms+4ms 04-16 18:07:20.515: D/dalvikvm(5993): GC_CONCURRENT freed 2049K, 29% free 18940K/26439K, paused 2ms+3ms 04-16 18:07:20.655: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 18935K/26439K, paused 2ms+4ms 04-16 18:07:20.795: D/dalvikvm(5993): GC_CONCURRENT freed 2032K, 29% free 18950K/26439K, paused 2ms+4ms 04-16 18:07:20.940: D/dalvikvm(5993): GC_CONCURRENT freed 2063K, 29% free 18935K/26439K, paused 2ms+4ms 04-16 18:07:21.085: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18938K/26439K, paused 1ms+4ms 04-16 18:07:21.225: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18935K/26439K, paused 2ms+4ms 04-16 18:07:21.365: D/dalvikvm(5993): GC_CONCURRENT freed 2046K, 29% free 18936K/26439K, paused 2ms+4ms 04-16 18:07:21.540: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18943K/26439K, paused 2ms+4ms 04-16 18:07:21.710: D/dalvikvm(5993): GC_CONCURRENT freed 2039K, 29% free 18951K/26439K, paused 2ms+4ms 04-16 18:07:21.850: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18943K/26439K, paused 1ms+4ms 04-16 18:07:21.995: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18958K/26439K, paused 1ms+4ms 04-16 18:07:22.150: D/dalvikvm(5993): GC_CONCURRENT freed 2051K, 29% free 18955K/26439K, paused 1ms+4ms 04-16 18:07:22.290: D/dalvikvm(5993): GC_CONCURRENT freed 2055K, 29% free 18947K/26439K, paused 1ms+4ms 04-16 18:07:22.460: D/dalvikvm(5993): GC_CONCURRENT freed 2029K, 29% free 18965K/26439K, paused 2ms+3ms 04-16 18:07:22.610: D/dalvikvm(5993): GC_CONCURRENT freed 2060K, 29% free 18953K/26439K, paused 2ms+5ms 04-16 18:07:22.755: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18952K/26439K, paused 1ms+4ms 04-16 18:07:22.900: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18959K/26439K, paused 2ms+5ms 04-16 18:07:23.040: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18951K/26439K, paused 2ms+3ms 04-16 18:07:23.185: D/dalvikvm(5993): GC_CONCURRENT freed 2035K, 29% free 18963K/26439K, paused 2ms+4ms 04-16 18:07:23.325: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18963K/26439K, paused 1ms+4ms 04-16 18:07:23.470: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18961K/26439K, paused 2ms+4ms 04-16 18:07:23.620: D/dalvikvm(5993): GC_CONCURRENT freed 2036K, 29% free 18972K/26439K, paused 2ms+4ms 04-16 18:07:23.760: D/dalvikvm(5993): GC_CONCURRENT freed 2062K, 29% free 18958K/26439K, paused 2ms+3ms 04-16 18:07:23.905: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 18960K/26439K, paused 2ms+4ms 04-16 18:07:24.050: D/dalvikvm(5993): GC_CONCURRENT freed 2049K, 29% free 18959K/26439K, paused 1ms+4ms 04-16 18:07:24.195: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18963K/26439K, paused 1ms+4ms 04-16 18:07:24.345: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18970K/26439K, paused 2ms+5ms 04-16 18:07:24.505: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 18964K/26439K, paused 2ms+5ms 04-16 18:07:24.675: D/dalvikvm(5993): GC_CONCURRENT freed 2040K, 29% free 18971K/26439K, paused 1ms+5ms 04-16 18:07:24.840: D/dalvikvm(5993): GC_CONCURRENT freed 2047K, 29% free 18972K/26439K, paused 2ms+5ms 04-16 18:07:25.005: D/dalvikvm(5993): GC_CONCURRENT freed 2039K, 29% free 18981K/26439K, paused 2ms+3ms 04-16 18:07:25.150: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18972K/26439K, paused 1ms+4ms 04-16 18:07:25.290: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18987K/26439K, paused 2ms+4ms 04-16 18:07:25.440: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18984K/26439K, paused 2ms+5ms 04-16 18:07:25.595: D/dalvikvm(5993): GC_CONCURRENT freed 2054K, 29% free 18978K/26439K, paused 2ms+4ms 04-16 18:07:25.740: D/dalvikvm(5993): GC_CONCURRENT freed 2034K, 29% free 18992K/26439K, paused 1ms+4ms 04-16 18:07:25.885: D/dalvikvm(5993): GC_CONCURRENT freed 2059K, 29% free 18980K/26439K, paused 1ms+4ms 04-16 18:07:26.025: D/dalvikvm(5993): GC_CONCURRENT freed 2048K, 29% free 18980K/26439K, paused 2ms+3ms 04-16 18:07:26.170: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18977K/26439K, paused 2ms+4ms 04-16 18:07:26.315: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 18982K/26439K, paused 1ms+4ms 04-16 18:07:26.455: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 18986K/26439K, paused 1ms+4ms 04-16 18:07:26.600: D/dalvikvm(5993): GC_CONCURRENT freed 2039K, 29% free 18994K/26439K, paused 2ms+5ms 04-16 18:07:26.745: D/dalvikvm(5993): GC_CONCURRENT freed 2057K, 29% free 18984K/26439K, paused 2ms+4ms 04-16 18:07:26.890: D/dalvikvm(5993): GC_CONCURRENT freed 2033K, 29% free 18999K/26439K, paused 2ms+4ms 04-16 18:07:27.040: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18997K/26439K, paused 1ms+4ms 04-16 18:07:27.195: D/dalvikvm(5993): GC_CONCURRENT freed 2056K, 29% free 18988K/26439K, paused 2ms+4ms 04-16 18:07:27.335: D/dalvikvm(5993): GC_CONCURRENT freed 2030K, 29% free 19005K/26439K, paused 1ms+4ms 04-16 18:07:27.480: D/dalvikvm(5993): GC_CONCURRENT freed 2060K, 29% free 18993K/26439K, paused 1ms+4ms 04-16 18:07:27.625: D/dalvikvm(5993): GC_CONCURRENT freed 2046K, 29% free 18994K/26439K, paused 2ms+4ms 04-16 18:07:27.770: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 18992K/26439K, paused 1ms+4ms 04-16 18:07:27.915: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 18994K/26439K, paused 1ms+4ms 04-16 18:07:28.060: D/dalvikvm(5993): GC_CONCURRENT freed 2042K, 29% free 19000K/26439K, paused 2ms+4ms 04-16 18:07:28.205: D/dalvikvm(5993): GC_CONCURRENT freed 2044K, 29% free 19003K/26439K, paused 2ms+4ms 04-16 18:07:28.355: D/dalvikvm(5993): GC_CONCURRENT freed 2055K, 29% free 18996K/26439K, paused 1ms+4ms 04-16 18:07:28.510: D/dalvikvm(5993): GC_CONCURRENT freed 2034K, 29% free 19009K/26439K, paused 2ms+4ms 04-16 18:07:28.655: D/dalvikvm(5993): GC_CONCURRENT freed 2049K, 29% free 19008K/26439K, paused 2ms+3ms 04-16 18:07:28.800: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 19006K/26439K, paused 2ms+5ms 04-16 18:07:28.945: D/dalvikvm(5993): GC_CONCURRENT freed 2038K, 29% free 19014K/26439K, paused 1ms+4ms 04-16 18:07:29.090: D/dalvikvm(5993): GC_CONCURRENT freed 2060K, 29% free 19002K/26439K, paused 1ms+4ms 04-16 18:07:29.240: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 19007K/26439K, paused 2ms+5ms 04-16 18:07:29.395: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 19002K/26439K, paused 2ms+3ms 04-16 18:07:29.540: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 19006K/26439K, paused 1ms+5ms 04-16 18:07:29.680: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 19008K/26439K, paused 1ms+3ms 04-16 18:07:29.825: D/dalvikvm(5993): GC_CONCURRENT freed 2041K, 29% free 19015K/26439K, paused 2ms+3ms 04-16 18:07:29.970: D/dalvikvm(5993): GC_CONCURRENT freed 2050K, 29% free 19012K/26439K, paused 2ms+3ms 04-16 18:07:30.115: D/dalvikvm(5993): GC_CONCURRENT freed 2038K, 29% free 19022K/26439K, paused 2ms+4ms 04-16 18:07:30.255: D/dalvikvm(5993): GC_CONCURRENT freed 2053K, 29% free 19016K/26439K, paused 1ms+3ms 04-16 18:07:30.400: D/dalvikvm(5993): GC_CONCURRENT freed 2043K, 29% free 19021K/26439K, paused 1ms+5ms 04-16 18:07:30.545: D/dalvikvm(5993): GC_CONCURRENT freed 2045K, 29% free 19024K/26439K, paused 1ms+4ms 04-16 18:07:30.690: D/dalvikvm(5993): GC_CONCURRENT freed 2042K, 29% free 19029K/26439K, paused 1ms+4ms Please help me how to solve this issue Thanks in Advance
You are probably doing a heavy task in your main thread that causes your UI to stuck. Can you post your entire main activity?
Framedrops --> Ideas for better Android Game rendering?
my simple application suffers from framedrop. I think this is due to my rendering method: public void draw(Canvas canvas) { drawBackground(canvas); drawPlayer(canvas); drawEnemy(canvas); } As you can see, the background gets drawn every single time this method is called, as well as player and enemy... the "drawBackground(canvas)" looks kinda like this: public void paintBackground(Canvas canvas) { canvas.drawBitmap(background, 0, 0, null); } drawPlayer and drawEnemy draw circles at the position my player/ or enemyobject returns. Is there any better solution for displaying background, player and other objects, without constantly redrawing them? Logcat: 02-14 17:30:11.904: D/dalvikvm(17783): GC_FOR_ALLOC freed 29K, 1% free 9069K/9132K, paused 17ms, total 18ms 02-14 17:30:11.912: I/dalvikvm-heap(17783): Grow heap (frag case) to 12.404MB for 3686416-byte allocation 02-14 17:30:11.927: D/dalvikvm(17783): GC_FOR_ALLOC freed <1K, 1% free 12669K/12736K, paused 20ms, total 20ms 02-14 17:30:12.341: D/dalvikvm(17783): GC_FOR_ALLOC freed 16K, 1% free 12696K/12748K, paused 24ms, total 24ms 02-14 17:30:12.349: I/dalvikvm-heap(17783): Grow heap (frag case) to 15.945MB for 3686416-byte allocation 02-14 17:30:12.373: D/dalvikvm(17783): GC_FOR_ALLOC freed <1K, 1% free 16296K/16352K, paused 24ms, total 24ms 02-14 17:30:12.560: D/OpenGLRenderer(17783): Enabling debug mode 0 02-14 17:30:18.045: D/dalvikvm(17783): GC_FOR_ALLOC freed 218K, 2% free 16377K/16632K, paused 20ms, total 20ms 02-14 17:30:18.052: I/dalvikvm-heap(17783): Grow heap (frag case) to 19.541MB for 3686416-byte allocation 02-14 17:30:18.076: D/dalvikvm(17783): GC_FOR_ALLOC freed 6K, 2% free 19971K/20236K, paused 21ms, total 22ms 02-14 17:30:28.529: D/dalvikvm(17783): GC_FOR_ALLOC freed 3899K, 20% free 16395K/20332K, paused 19ms, total 19ms 02-14 17:30:28.537: I/dalvikvm-heap(17783): Grow heap (frag case) to 19.557MB for 3686416-byte allocation 02-14 17:30:28.560: D/dalvikvm(17783): GC_FOR_ALLOC freed <1K, 2% free 19995K/20332K, paused 18ms, total 18ms 02-14 17:30:49.756: D/dalvikvm(17783): GC_FOR_ALLOC freed 4050K, 20% free 16464K/20552K, paused 20ms, total 34ms 02-14 17:30:49.763: I/dalvikvm-heap(17783): Grow heap (frag case) to 19.625MB for 3686416-byte allocation 02-14 17:30:49.779: D/dalvikvm(17783): GC_FOR_ALLOC freed 6K, 3% free 20057K/20552K, paused 21ms, total 21ms 02-14 17:30:57.107: D/dalvikvm(17783): GC_FOR_ALLOC freed 3938K, 21% free 16373K/20552K, paused 17ms, total 17ms 02-14 17:30:57.107: I/dalvikvm-heap(17783): Grow heap (frag case) to 19.536MB for 3686416-byte allocation 02-14 17:30:57.138: D/dalvikvm(17783): GC_FOR_ALLOC freed 14K, 3% free 19958K/20552K, paused 13ms, total 13ms 02-14 17:31:03.310: D/dalvikvm(17783): GC_FOR_ALLOC freed 3824K, 21% free 16370K/20552K, paused 31ms, total 31ms 02-14 17:31:03.310: I/dalvikvm-heap(17783): Grow heap (frag case) to 19.533MB for 3686416-byte allocation 02-14 17:31:03.381: D/dalvikvm(17783): GC_FOR_ALLOC freed 7K, 3% free 19962K/20552K, paused 30ms, total 30ms 02-14 17:33:31.943: D/dalvikvm(17783): GC_FOR_ALLOC freed 6253K, 27% free 17352K/23640K, paused 37ms, total 39ms Thanks in advance
Android OOM, memory is never released
I am developing on Android 2.3.3 API Lv10. My app uses the 'LoaderManager' interface to load images in the background, and the images are displayed in a ViewPager. If I repeat viewing the images, the app will crash eventually. It looks like the app allocate memory to fast, and the GC is not able to release some of it. Is there any way to track which object is hold in memory? 02-02 18:02:05.564: D/dalvikvm(255): GC_EXPLICIT freed 500K, 55% free 2599K/5703K, external 1625K/2137K, paused 534ms 02-02 18:02:05.714: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 365K, 54% free 2680K/5703K, external 3045K/3338K, paused 54ms 02-02 18:02:06.074: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 59K, 54% free 2677K/5703K, external 4211K/5259K, paused 62ms 02-02 18:02:10.645: D/dalvikvm(316): GC_EXPLICIT freed 322K, **54% free** 2539K/5511K, external 1625K/2137K, paused 100ms 02-02 18:02:53.054: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 109K, **53% free** 2684K/5703K, external 6691K/6808K, paused 48ms 02-02 18:03:16.834: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 604K, 55% free 2720K/5959K, external 8954K/9904K, paused 52ms 02-02 18:03:18.304: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 114K, 55% free 2711K/5959K, external 6160K/6211K, paused 47ms 02-02 18:03:21.534: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 128K, 55% free 2731K/5959K, external 8375K/9165K, paused 38ms 02-02 18:03:29.154: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 612K, 55% free 2757K/6023K, external 10236K/11261K, paused 50ms 02-02 18:03:30.394: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 90K, 55% free 2719K/6023K, external 8070K/8080K, paused 45ms 02-02 18:03:33.944: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 571K, 54% free 2786K/6023K, external 9093K/10112K, paused 74ms 02-02 18:03:36.304: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 115K, 54% free 2777K/6023K, external 7952K/8724K, paused 45ms 02-02 18:03:41.194: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 319K, 53% free 2877K/6023K, external 10954K/10980K, paused 51ms 02-02 18:03:58.054: I/dalvikvm(389): Jit: resizing JitTable from 512 to 1024 02-02 18:03:58.454: D/dalvikvm(389): GC_CONCURRENT freed 1254K, 58% free 2841K/6727K, external 8152K/8375K, paused 4ms+5ms 02-02 18:04:01.314: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 80K, 58% free 2847K/6727K, external 8078K/8375K, paused 57ms 02-02 18:04:02.244: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 66K, 58% free 2884K/6727K, external 10625K/11366K, paused 40ms 02-02 18:04:07.614: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 191K, 58% free 2874K/6727K, external 13698K/14474K, paused 49ms 02-02 18:04:16.104: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 566K, 57% free 2925K/6727K, external 12504K/12547K, paused 41ms 02-02 18:04:16.574: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 194K, 58% free 2837K/6727K, external 8589K/9589K, paused 51ms 02-02 18:04:18.774: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 71K, 58% free 2862K/6727K, external 9048K/11075K, paused 40ms 02-02 18:04:20.705: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 108K, 58% free 2859K/6727K, external 11804K/12545K, paused 49ms 02-02 18:04:22.475: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 52K, 58% free 2861K/6727K, external 14210K/16258K, paused 40ms 02-02 18:04:24.044: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 52K, 58% free 2863K/6727K, external 16920K/18968K, paused 47ms 02-02 18:04:24.153: E/dalvikvm-heap(389): 1232160-byte external allocation too large for this process. 02-02 18:04:24.255: D/dalvikvm(389): GC_FOR_MALLOC freed <1K, 58% free 2863K/6727K, external 16920K/18968K, paused 29ms 02-02 18:04:24.265: W/dalvikvm(389): threadid=9: thread exiting with uncaught exception (group=0x40015560) 02-02 18:04:24.565: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 91K, 58% free 2850K/6727K, external 16967K/18968K, paused 149ms 02-02 18:04:25.664: D/dalvikvm(389): GC_FOR_MALLOC freed 0K, 58% free 2850K/6727K, external 17021K/18968K, paused 161ms 02-02 18:04:27.144: D/dalvikvm(389): GC_EXTERNAL_ALLOC freed 39K, 58% free 2880K/6727K, external 17000K/18968K, paused 49ms 02-02 18:04:27.364: I/dalvikvm-heap(389): Clamp target GC heap from 24.004MB to 24.000MB 02-02 18:04:27.374: D/dalvikvm(389): GC_FOR_MALLOC freed <1K, 58% free 2880K/6727K, external 17048K/18968K, paused 29ms 02-02 17:48:09.424: D/dalvikvm(337): GC_CONCURRENT freed 1400K, 61% free 2686K/6727K, external 3045K/3330K, paused 4ms+4ms 02-02 17:48:10.284: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 58K, 60% free 2707K/6727K, external 2972K/3330K, paused 37ms 02-02 17:48:11.664: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 78K, 60% free 2709K/6727K, external 3842K/4799K, paused 44ms 02-02 17:48:17.364: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 161K, 60% free 2719K/6727K, external 5843K/6032K, paused 41ms 02-02 17:48:25.824: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 157K, 60% free 2726K/6727K, external 8108K/8682K, paused 76ms 02-02 17:48:30.084: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 157K, 60% free 2732K/6727K, external 10488K/11355K, paused 63ms 02-02 17:48:39.704: D/dalvikvm(337): GC_CONCURRENT freed 742K, 58% free 2888K/6727K, external 12840K/13865K, paused 4ms+3ms 02-02 17:48:43.895: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 893K, 60% free 2749K/6727K, external 3941K/4896K, paused 52ms 02-02 17:48:58.414: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 160K, 60% free 2750K/6727K, external 6400K/6445K, paused 55ms 02-02 17:49:02.324: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 375K, 59% free 2821K/6727K, external 9503K/9541K, paused 43ms 02-02 17:49:03.755: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 320K, 59% free 2777K/6727K, external 4944K/5945K, paused 69ms 02-02 17:49:08.184: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 212K, 59% free 2767K/6727K, external 7593K/7630K, paused 46ms 02-02 17:49:10.914: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 451K, 59% free 2805K/6727K, external 5893K/6353K, paused 50ms 02-02 17:49:15.294: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 163K, 58% free 2843K/6727K, external 9263K/9265K, paused 39ms 02-02 17:49:16.434: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 499K, 58% free 2835K/6727K, external 6842K/7538K, paused 76ms 02-02 17:49:18.824: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 109K, 58% free 2831K/6727K, external 9008K/9765K, paused 43ms 02-02 17:49:25.774: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 645K, 59% free 2816K/6727K, external 12225K/12235K, paused 53ms 02-02 17:49:35.494: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 60K, 58% free 2864K/6727K, external 10256K/12304K, paused 54ms 02-02 17:49:59.824: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 1593K, 60% free 2905K/7111K, external 13747K/14632K, paused 58ms 02-02 17:50:02.764: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 114K, 59% free 2927K/7111K, external 11181K/12092K, paused 73ms 02-02 17:50:04.605: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 151K, 59% free 2935K/7111K, external 13655K/14466K, paused 47ms 02-02 17:50:09.174: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 513K, 59% free 2970K/7111K, external 15783K/15803K, paused 49ms 02-02 17:50:14.434: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 247K, 59% free 2926K/7111K, external 11360K/11714K, paused 52ms 02-02 17:50:20.464: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 608K, 59% free 2960K/7111K, external 13909K/14934K, paused 50ms 02-02 17:50:24.415: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 143K, 59% free 2980K/7111K, external 14651K/15393K, paused 43ms 02-02 17:50:24.655: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed 0K, 59% free 2980K/7111K, external 14651K/15393K, paused 49ms 02-02 17:50:24.725: I/dalvikvm-heap(337): Clamp target GC heap from 24.113MB to 24.000MB 02-02 17:50:24.725: D/dalvikvm(337): GC_FOR_MALLOC freed <1K, 59% free 2980K/7111K, external 17058K/19106K, paused 59ms 02-02 17:50:24.805: D/dalvikvm(337): GC_EXTERNAL_ALLOC freed <1K, 59% free 2980K/7111K, external 17058K/19106K, paused 69ms 02-02 17:50:25.045: E/dalvikvm-heap(337): 2774400-byte external allocation too large for this process. 02-02 17:50:25.115: I/dalvikvm-heap(337): Clamp target GC heap from 24.112MB to 24.000MB 02-02 17:50:25.115: D/dalvikvm(337): GC_FOR_MALLOC freed 0K, 59% free 2980K/7111K, external 17058K/19106K, paused 56ms 02-02 17:50:25.304: E/GraphicsJNI(337): VM won't let us allocate 2774400 bytes
The links given by #JoxTraex are great. But to this issue, I finally found the root cause. It is the LoaderManager which holds a reference to the Loader object and the object returned by the Loader.loadInBackground method. After calling the LoaderManager.destroyLoader(id), the problem is gone forever.
This is quite a topic that is kind of hard to tackle, specifically if you keep a reference to your Bitmaps, then you start overloading memory. This is because images are VERY heavy in terms of memory/VM. You should have a look at what Romain Guy says about graphics and Bitmaps and how to handle it. Here: http://www.youtube.com/watch?v=duefsFTJXzc http://www.youtube.com/watch?v=wJYTBjMZJh0 They are lengthy videos, but have lots of good information and some of this includes how to handle this with best practices.