jjzjj

android - 停止的服务正在做持续的垃圾收集

coder 2023-06-07 原文

我正在开发一个包含许多服务的应用程序。当我停止 Intent 服务时,所有线程和服务都应该停止,但 UI 挂起并且 logcat 中出现以下错误:

2014-12-01 12: 37: 92I/art     (32099): Background partial concurrent mark sweep GC freed 419756(33MB) AllocSpace objects, 15(4MB) LOS objects, 38% free, 25MB/41MB, paused 1.617ms total 451.976ms
2014-12-01 12: 37: 40I/art     (32099): Background sticky concurrent mark sweep GC freed 290680(16MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/33MB, paused 23.287ms total 229.513ms
2014-12-01 12: 37: 29I/art     (32099): Background partial concurrent mark sweep GC freed 165880(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.648ms total 203.601ms
2014-12-01 12: 37: 54I/art     (32099): Background sticky concurrent mark sweep GC freed 269770(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 2.533ms total 207.538ms
2014-12-01 12: 37: 54I/art     (32099): WaitForGcToComplete blocked for 170.151ms for cause HeapTrim
2014-12-01 12: 37: 22I/art     (32099): Background partial concurrent mark sweep GC freed 155347(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 1.464ms total 181.474ms
2014-12-01 12: 38: 45I/art     (32099): Background sticky concurrent mark sweep GC freed 267766(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.556ms total 149.855ms
2014-12-01 12: 38: 11I/art     (32099): Background sticky concurrent mark sweep GC freed 137696(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.617ms total 125.255ms
2014-12-01 12: 38: 82I/art     (32099): Background partial concurrent mark sweep GC freed 148859(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.373ms total 216.542ms
2014-12-01 12: 38: 11I/art     (32099): Background sticky concurrent mark sweep GC freed 276636(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.403ms total 156.661ms
2014-12-01 12: 38: 97I/art     (32099): Background sticky concurrent mark sweep GC freed 139573(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.464ms total 115.336ms
2014-12-01 12: 38: 85I/art     (32099): Background partial concurrent mark sweep GC freed 151267(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 2.227ms total 210.346ms
2014-12-01 12: 38: 44I/art     (32099): Background sticky concurrent mark sweep GC freed 268102(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.495ms total 148.542ms
2014-12-01 12: 38: 27I/art     (32099): Background sticky concurrent mark sweep GC freed 137761(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.587ms total 119.121ms
2014-12-01 12: 38: 26I/art     (32099): Background partial concurrent mark sweep GC freed 154492(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 2.533ms total 314.939ms
2014-12-01 12: 38: 75I/art     (32099): Thread[5,tid=32108,WaitingInMainSignalCatcherLoop,Thread*=0xb8111d98,peer=0x12c07080,"Signal Catcher"]: reacting to signal 3
2014-12-01 12: 38: 79W/art     (32099): Suspending all threads took: 13.062ms
2014-12-01 12: 38: 80I/art     (32099): Wrote stack traces to '/data/anr/traces.txt'
2014-12-01 12: 38: 89I/art     (32099): Background sticky concurrent mark sweep GC freed 278516(15MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 23MB/31MB, paused 2.533ms total 1.049s
2014-12-01 12: 38: 13I/art     (32099): Background partial concurrent mark sweep GC freed 137132(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 4.211ms total 188.951ms
2014-12-01 12: 38: 42I/art     (32099): Background sticky concurrent mark sweep GC freed 271335(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.998ms total 236.868ms
2014-12-01 12: 38: 41I/art     (32099): Background sticky concurrent mark sweep GC freed 143812(8MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 6.470ms total 201.800ms
2014-12-01 12: 38: 36I/art     (32099): Background partial concurrent mark sweep GC freed 159223(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 5.524ms total 215.809ms
2014-12-01 12: 38: 61I/art     (32099): Background sticky concurrent mark sweep GC freed 278158(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.922ms total 201.617ms
2014-12-01 12: 38: 41I/art     (32099): WaitForGcToComplete blocked for 46.696ms for cause HeapTrim
2014-12-01 12: 38: 79I/art     (32099): Background sticky concurrent mark sweep GC freed 136821(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 1.709ms total 123.729ms
2014-12-01 12: 38: 30I/art     (32099): Background sticky concurrent mark sweep GC freed 116947(6MB) AllocSpace objects, 0(0B) LOS objects, 20% free, 25MB/32MB, paused 5.554ms total 138.501ms
2014-12-01 12: 38: 44I/art     (32099): Background sticky concurrent mark sweep GC freed 117175(6MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 25MB/32MB, paused 1.678ms total 104.257ms
2014-12-01 12: 38: 19I/art     (32099): Background sticky concurrent mark sweep GC freed 110760(6MB) AllocSpace objects, 0(0B) LOS objects, 18% free, 26MB/32MB, paused 1.587ms total 104.959ms
2014-12-01 12: 39: 37I/art     (32099): Background sticky concurrent mark sweep GC freed 88168(4MB) AllocSpace objects, 0(0B) LOS objects, 15% free, 27MB/32MB, paused 3.876ms total 114.878ms
2014-12-01 12: 39: 54I/art     (32099): Background partial concurrent mark sweep GC freed 136364(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.648ms total 102.212ms
2014-12-01 12: 39: 60I/art     (32099): Background sticky concurrent mark sweep GC freed 287788(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.418ms total 196.154ms
2014-12-01 12: 39: 80I/art     (32099): Background sticky concurrent mark sweep GC freed 156308(8MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 23MB/31MB, paused 3.998ms total 184.495ms
2014-12-01 12: 39: 33I/art     (32099): Background partial concurrent mark sweep GC freed 148206(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.831ms total 103.738ms
2014-12-01 12: 39: 59I/art     (32099): Background sticky concurrent mark sweep GC freed 283901(15MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 23MB/31MB, paused 2.502ms total 144.086ms
2014-12-01 12: 39: 43I/art     (32099): Background sticky concurrent mark sweep GC freed 134828(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/31MB, paused 2.533ms total 130.291ms
2014-12-01 12: 39: 44I/art     (32099): WaitForGcToComplete blocked for 94.277ms for cause HeapTrim
2014-12-01 12: 39: 95I/art     (32099): Background sticky concurrent mark sweep GC freed 133441(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/31MB, paused 5.035ms total 139.722ms
2014-12-01 12: 39: 47I/art     (32099): Background partial concurrent mark sweep GC freed 148395(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 2.227ms total 122.722ms
2014-12-01 12: 39: 79I/art     (32099): Background sticky concurrent mark sweep GC freed 280706(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.495ms total 175.156ms
2014-12-01 12: 39: 44I/art     (32099): Background sticky concurrent mark sweep GC freed 144094(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 2.258ms total 140.119ms
2014-12-01 12: 39: 06I/art     (32099): Background partial concurrent mark sweep GC freed 152123(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 1.892ms total 108.957ms
2014-12-01 12: 39: 99I/art     (32099): Background sticky concurrent mark sweep GC freed 281291(15MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 23MB/31MB, paused 6.104ms total 201.190ms
2014-12-01 12: 39: 02I/art     (32099): Background sticky concurrent mark sweep GC freed 136650(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/31MB, paused 41.049ms total 120.372ms
2014-12-01 12: 39: 56I/art     (32099): Background sticky concurrent mark sweep GC freed 134333(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/31MB, paused 1.831ms total 130.260ms
2014-12-01 12: 39: 15I/art     (32099): Background partial concurrent mark sweep GC freed 145994(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 1.800ms total 302.243ms
2014-12-01 12: 39: 49I/art     (32099): Background sticky concurrent mark sweep GC freed 285630(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 2.716ms total 235.434ms
2014-12-01 12: 39: 30I/art     (32099): Background sticky concurrent mark sweep GC freed 147718(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.845ms total 176.560ms
2014-12-01 12: 39: 94I/art     (32099): Background partial concurrent mark sweep GC freed 157542(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.831ms total 178.879ms
2014-12-01 12: 39: 39I/art     (32099): Background sticky concurrent mark sweep GC freed 278485(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.495ms total 219.105ms
2014-12-01 12: 39: 90I/art     (32099): Background sticky concurrent mark sweep GC freed 147110(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.495ms total 143.293ms
2014-12-01 12: 39: 44I/art     (32099): Background sticky concurrent mark sweep GC freed 139322(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 2.197ms total 171.036ms
2014-12-01 12: 39: 10I/art     (32099): Background partial concurrent mark sweep GC freed 155748(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 4.455ms total 268.915ms
2014-12-01 12: 39: 06I/art     (32099): Background sticky concurrent mark sweep GC freed 283584(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.770ms total 226.094ms
2014-12-01 12: 39: 13I/art     (32099): Background sticky concurrent mark sweep GC freed 14809(850KB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 5.920ms total 63.573ms
2014-12-01 12: 40: 05I/art     (32099): Background partial concurrent mark sweep GC freed 149252(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.556ms total 177.445ms
2014-12-01 12: 40: 74I/art     (32099): Background sticky concurrent mark sweep GC freed 277718(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.631ms total 164.901ms
2014-12-01 12: 40: 29I/art     (32099): Background sticky concurrent mark sweep GC freed 144490(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.464ms total 134.198ms
2014-12-01 12: 40: 81I/art     (32099): Background sticky concurrent mark sweep GC freed 139991(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 1.709ms total 127.941ms
2014-12-01 12: 40: 38I/art     (32099): Background sticky concurrent mark sweep GC freed 135726(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.495ms total 168.411ms
2014-12-01 12: 40: 86I/art     (32099): Background partial concurrent mark sweep GC freed 155118(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.403ms total 217.701ms
2014-12-01 12: 40: 10I/art     (32099): Background sticky concurrent mark sweep GC freed 277621(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 5.035ms total 199.694ms
2014-12-01 12: 40: 91I/art     (32099): Background sticky concurrent mark sweep GC freed 137844(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 1.342ms total 137.830ms
2014-12-01 12: 40: 51I/art     (32099): Background sticky concurrent mark sweep GC freed 133133(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 24MB/32MB, paused 1.892ms total 161.056ms
2014-12-01 12: 40: 92I/art     (32099): Background partial concurrent mark sweep GC freed 148389(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 2.105ms total 201.587ms
2014-12-01 12: 40: 00I/art     (32099): Background sticky concurrent mark sweep GC freed 286110(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.082ms total 269.739ms
2014-12-01 12: 40: 88I/art     (32099): Background sticky concurrent mark sweep GC freed 147157(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.403ms total 142.682ms
2014-12-01 12: 40: 23W/art     (32099): Suspending all threads took: 20.692ms
2014-12-01 12: 40: 38I/art     (32099): Background sticky concurrent mark sweep GC freed 142717(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 26.003ms total 177.750ms
2014-12-01 12: 40: 04I/art     (32099): Background partial concurrent mark sweep GC freed 152961(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 3.692ms total 252.952ms
2014-12-01 12: 40: 36I/art     (32099): Background sticky concurrent mark sweep GC freed 285533(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.190ms total 201.770ms
2014-12-01 12: 40: 01I/art     (32099): Background sticky concurrent mark sweep GC freed 142805(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 3.876ms total 194.781ms
2014-12-01 12: 40: 57I/art     (32099): Background partial concurrent mark sweep GC freed 154279(8MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 23MB/39MB, paused 2.716ms total 242.118ms
2014-12-01 12: 40: 46I/art     (32099): Background sticky concurrent mark sweep GC freed 282196(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 25MB/33MB, paused 1.861ms total 261.071ms
2014-12-01 12: 40: 05I/art     (32099): Background sticky concurrent mark sweep GC freed 150004(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.617ms total 153.059ms
2014-12-01 12: 40: 88I/art     (32099): Background sticky concurrent mark sweep GC freed 141501(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 3.204ms total 143.842ms
2014-12-01 12: 40: 32I/art     (32099): Background sticky concurrent mark sweep GC freed 137981(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 1.861ms total 121.806ms
2014-12-01 12: 40: 07I/art     (32099): Background sticky concurrent mark sweep GC freed 132198(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.526ms total 125.133ms
2014-12-01 12: 40: 07I/art     (32099): WaitForGcToComplete blocked for 25.515ms for cause HeapTrim
2014-12-01 12: 40: 53I/art     (32099): Background sticky concurrent mark sweep GC freed 128414(7MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 2.716ms total 162.520ms
2014-12-01 12: 40: 16I/art     (32099): Background partial concurrent mark sweep GC freed 153325(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 1.770ms total 241.812ms
2014-12-01 12: 40: 14I/art     (32099): Background sticky concurrent mark sweep GC freed 281944(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 25MB/33MB, paused 1.464ms total 234.915ms
2014-12-01 12: 40: 59I/art     (32099): Background sticky concurrent mark sweep GC freed 152568(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 11.628ms total 135.602ms
2014-12-01 12: 40: 29I/art     (32099): Background sticky concurrent mark sweep GC freed 140163(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 2.319ms total 162.826ms
2014-12-01 12: 40: 92I/art     (32099): Background sticky concurrent mark sweep GC freed 134281(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.983ms total 185.685ms
2014-12-01 12: 40: 39I/art     (32099): Background partial concurrent mark sweep GC freed 151800(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 5.585ms total 294.216ms
2014-12-01 12: 40: 56I/art     (32099): Background sticky concurrent mark sweep GC freed 286752(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.373ms total 241.385ms
2014-12-01 12: 41: 28I/art     (32099): Background sticky concurrent mark sweep GC freed 144618(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 3.082ms total 109.446ms
2014-12-01 12: 41: 97I/art     (32099): Background sticky concurrent mark sweep GC freed 136091(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 1.190ms total 134.381ms
2014-12-01 12: 41: 64I/art     (32099): Background sticky concurrent mark sweep GC freed 134936(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.251ms total 105.356ms
2014-12-01 12: 41: 00I/art     (32099): WaitForGcToComplete blocked for 5.035ms for cause HomogeneousSpaceCompact
2014-12-01 12: 41: 51I/art     (32099): Background sticky concurrent mark sweep GC freed 124518(6MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 24MB/31MB, paused 1.739ms total 130.566ms
2014-12-01 12: 41: 85I/art     (32099): Background sticky concurrent mark sweep GC freed 112812(6MB) AllocSpace objects, 0(0B) LOS objects, 20% free, 25MB/31MB, paused 1.251ms total 105.631ms
2014-12-01 12: 41: 09I/art     (32099): Background sticky concurrent mark sweep GC freed 104949(5MB) AllocSpace objects, 0(0B) LOS objects, 18% free, 25MB/31MB, paused 2.350ms total 141.400ms
2014-12-01 12: 41: 40I/art     (32099): Background partial concurrent mark sweep GC freed 125914(7MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.434ms total 137.158ms
2014-12-01 12: 41: 87W/art     (32099): Suspending all threads took: 19.502ms
2014-12-01 12: 41: 05I/art     (32099): Background sticky concurrent mark sweep GC freed 276391(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 24.050ms total 233.969ms
2014-12-01 12: 41: 10I/art     (32099): Background sticky concurrent mark sweep GC freed 140307(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 1.678ms total 117.900ms
2014-12-01 12: 41: 68I/art     (32099): Background sticky concurrent mark sweep GC freed 132233(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.617ms total 111.521ms
2014-12-01 12: 41: 32I/art     (32099): Background sticky concurrent mark sweep GC freed 127744(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.587ms total 110.880ms
2014-12-01 12: 41: 62I/art     (32099): Background sticky concurrent mark sweep GC freed 124145(6MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 4.883ms total 117.869ms
2014-12-01 12: 41: 88I/art     (32099): Background sticky concurrent mark sweep GC freed 114064(6MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 26MB/32MB, paused 1.709ms total 121.898ms
2014-12-01 12: 41: 61I/art     (32099): Background sticky concurrent mark sweep GC freed 106523(5MB) AllocSpace objects, 0(0B) LOS objects, 18% free, 26MB/32MB, paused 2.166ms total 131.817ms
2014-12-01 12: 41: 34I/art     (32099): Background sticky concurrent mark sweep GC freed 99159(5MB) AllocSpace objects, 0(0B) LOS objects, 16% free, 27MB/32MB, paused 1.617ms total 132.702ms
2014-12-01 12: 41: 60I/art     (32099): Background partial concurrent mark sweep GC freed 135913(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 23MB/39MB, paused 1.281ms total 145.856ms
2014-12-01 12: 41: 40I/art     (32099): Background sticky concurrent mark sweep GC freed 276563(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 6.775ms total 194.170ms
2014-12-01 12: 41: 40I/art     (32099): WaitForGcToComplete blocked for 41.721ms for cause HeapTrim
2014-12-01 12: 41: 62I/art     (32099): Background sticky concurrent mark sweep GC freed 135682(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 1.648ms total 105.508ms
2014-12-01 12: 41: 99I/art     (32099): Background sticky concurrent mark sweep GC freed 131287(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 2.441ms total 123.241ms
2014-12-01 12: 41: 55I/art     (32099): Background sticky concurrent mark sweep GC freed 128189(7MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 2.685ms total 159.987ms
2014-12-01 12: 41: 93I/art     (32099): Background partial concurrent mark sweep GC freed 146571(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 21.638ms total 212.330ms
2014-12-01 12: 42: 03I/art     (32099): Background sticky concurrent mark sweep GC freed 282301(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 4.394ms total 191.423ms
2014-12-01 12: 42: 46I/art     (32099): Background sticky concurrent mark sweep GC freed 144030(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.312ms total 105.020ms
2014-12-01 12: 42: 16I/art     (32099): Background sticky concurrent mark sweep GC freed 135791(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 24MB/32MB, paused 5.096ms total 134.198ms
2014-12-01 12: 42: 77I/art     (32099): Background sticky concurrent mark sweep GC freed 132569(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 1.312ms total 113.871ms
2014-12-01 12: 42: 49I/art     (32099): Background partial concurrent mark sweep GC freed 158851(9MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 3.540ms total 222.890ms
2014-12-01 12: 42: 79I/art     (32099): Background sticky concurrent mark sweep GC freed 282779(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 25MB/33MB, paused 3.082ms total 205.371ms
2014-12-01 12: 42: 31I/art     (32099): Background sticky concurrent mark sweep GC freed 145527(8MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.648ms total 111.857ms
2014-12-01 12: 42: 93I/art     (32099): Background sticky concurrent mark sweep GC freed 136635(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 1.770ms total 109.415ms
2014-12-01 12: 42: 38I/art     (32099): Background sticky concurrent mark sweep GC freed 131901(7MB) AllocSpace objects, 0(0B) LOS objects, 22% free, 25MB/32MB, paused 2.044ms total 129.558ms
2014-12-01 12: 42: 93I/art     (32099): Background sticky concurrent mark sweep GC freed 127795(7MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 3.509ms total 128.734ms
2014-12-01 12: 42: 31I/art     (32099): Background sticky concurrent mark sweep GC freed 123525(6MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 1.678ms total 112.131ms
2014-12-01 12: 42: 61I/art     (32099): Background sticky concurrent mark sweep GC freed 120526(6MB) AllocSpace objects, 0(0B) LOS objects, 20% free, 26MB/32MB, paused 3.174ms total 112.406ms
2014-12-01 12: 42: 77I/art     (32099): Background sticky concurrent mark sweep GC freed 117214(6MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 26MB/32MB, paused 2.685ms total 155.501ms
2014-12-01 12: 42: 27I/art     (32099): Background partial concurrent mark sweep GC freed 146608(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 1.373ms total 148.359ms
2014-12-01 12: 42: 84I/art     (32099): Background sticky concurrent mark sweep GC freed 277503(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 35.006ms total 188.402ms
2014-12-01 12: 42: 49I/art     (32099): Background sticky concurrent mark sweep GC freed 139325(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 2.319ms total 125.194ms
2014-12-01 12: 42: 98I/art     (32099): Background sticky concurrent mark sweep GC freed 134919(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 3.357ms total 129.192ms
2014-12-01 12: 42: 01I/art     (32099): Background sticky concurrent mark sweep GC freed 127642(7MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 1.434ms total 125.133ms
2014-12-01 12: 42: 23I/art     (32099): Background sticky concurrent mark sweep GC freed 125587(6MB) AllocSpace objects, 0(0B) LOS objects, 21% free, 25MB/32MB, paused 2.350ms total 123.363ms
2014-12-01 12: 42: 79I/art     (32099): Background sticky concurrent mark sweep GC freed 119217(6MB) AllocSpace objects, 0(0B) LOS objects, 20% free, 26MB/32MB, paused 5.615ms total 127.819ms
2014-12-01 12: 42: 01I/art     (32099): Background sticky concurrent mark sweep GC freed 115621(6MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 26MB/32MB, paused 1.800ms total 124.889ms
2014-12-01 12: 42: 50I/art     (32099): Background sticky concurrent mark sweep GC freed 109559(6MB) AllocSpace objects, 0(0B) LOS objects, 19% free, 26MB/32MB, paused 1.495ms total 103.708ms
2014-12-01 12: 42: 71I/art     (32099): Background sticky concurrent mark sweep GC freed 103671(5MB) AllocSpace objects, 0(0B) LOS objects, 17% free, 27MB/32MB, paused 4.028ms total 137.524ms
2014-12-01 12: 42: 84I/art     (32099): Background partial concurrent mark sweep GC freed 140033(8MB) AllocSpace objects, 0(0B) LOS objects, 39% free, 24MB/40MB, paused 1.648ms total 222.646ms
2014-12-01 12: 42: 79I/art     (32099): Background sticky concurrent mark sweep GC freed 285098(15MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 12.055ms total 181.199ms
2014-12-01 12: 42: 24I/art     (32099): Background sticky concurrent mark sweep GC freed 143445(7MB) AllocSpace objects, 0(0B) LOS objects, 24% free, 24MB/32MB, paused 1.556ms total 119.517ms
2014-12-01 12: 42: 75I/art     (32099): Background sticky concurrent mark sweep GC freed 138529(7MB) AllocSpace objects, 0(0B) LOS objects, 23% free, 25MB/32MB, paused 1.892ms total 128.673ms

可能是什么问题?以及如何解决?

最佳答案

分析您的应用 - 我通过这种方式找到了类似问题的原因。

Android Studio: Tools -> Android -> Android Device Monitor

选择您的应用,然后在顶部(左侧)选择:

Start method profiling

一段时间后停下来看看结果。

关于android - 停止的服务正在做持续的垃圾收集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27224175/

有关android - 停止的服务正在做持续的垃圾收集的更多相关文章

  1. ruby - 使用 ruby​​ 和 savon 的 SOAP 服务 - 2

    我正在尝试使用ruby​​和Savon来使用网络服务。测试服务为http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2require'rubygems'require'savon'client=Savon::Client.new"http://www.webservicex.net/stockquote.asmx?WSDL"client.get_quotedo|soap|soap.body={:symbol=>"AAPL"}end返回SOAP异常。检查soap信封,在我看来soap请求没有正确的命名空间。任何人都可以建议我

  2. ruby - 具有身份验证的私有(private) Ruby Gem 服务器 - 2

    我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..

  3. ruby-on-rails - 启动 Rails 服务器时 ImageMagick 的警告 - 2

    最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru

  4. ruby-on-rails - s3_direct_upload 在生产服务器中不工作 - 2

    在Rails4.0.2中,我使用s3_direct_upload和aws-sdkgems直接为s3存储桶上传文件。在开发环境中它工作正常,但在生产环境中它会抛出如下错误,ActionView::Template::Error(noimplicitconversionofnilintoString)在View中,create_cv_url,:id=>"s3_uploader",:key=>"cv_uploads/{unique_id}/${filename}",:key_starts_with=>"cv_uploads/",:callback_param=>"cv[direct_uplo

  5. ruby - 用 Ruby 编写一个简单的网络服务器 - 2

    我想在Ruby中创建一个用于开发目的的极其简单的Web服务器(不,不想使用现成的解决方案)。代码如下:#!/usr/bin/rubyrequire'socket'server=TCPServer.new('127.0.0.1',8080)whileconnection=server.acceptheaders=[]length=0whileline=connection.getsheaders想法是从命令行运行这个脚本,提供另一个脚本,它将在其标准输入上获取请求,并在其标准输出上返回完整的响应。到目前为止一切顺利,但事实证明这真的很脆弱,因为它在第二个请求上中断并出现错误:/usr/b

  6. ruby-on-rails - 在 Rails 中调试生产服务器 - 2

    您如何在Rails中的实时服务器上进行有效调试,无论是在测试版/生产服务器上?我试过直接在服务器上修改文件,然后重启应用,但是修改好像没有生效,或者需要很长时间(缓存?)我也试过在本地做“脚本/服务器生产”,但是那很慢另一种选择是编码和部署,但效率很低。有人对他们如何有效地做到这一点有任何见解吗? 最佳答案 我会回答你的问题,即使我不同意这种热修补服务器代码的方式:)首先,你真的确定你已经重启了服务器吗?您可以通过跟踪日志文件来检查它。您更改的代码显示的View可能会被缓存。缓存页面位于tmp/cache文件夹下。您可以尝试手动删除

  7. jenkins部署1--jenkins+gitee持续集成 - 2

    前置步骤我们都操作完了,这篇开始介绍jenkins的集成。话不多说,看操作1、登录进入jenkins后会让你选择安装插件,选择第一个默认的就行。安装完成后设置账号密码,重新登录。2、配置JDK和Git都需要执行路径,所以需要先把执行路径找到,先进入服务器的docker容器,2.1JDK的路径root@69eef9ee86cf:/usr/bin#echo$JAVA_HOME/usr/local/openjdk-82.2Git的路径root@69eef9ee86cf:/#whichgit/usr/bin/git3、先配置JDK和Git。点击:ManageJenkins>>GlobalToolCon

  8. 安卓apk修改(Android反编译apk) - 2

    最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路

  9. ruby - 我的 Ruby IRC 机器人没有连接到 IRC 服务器。我究竟做错了什么? - 2

    require"socket"server="irc.rizon.net"port="6667"nick="RubyIRCBot"channel="#0x40"s=TCPSocket.open(server,port)s.print("USERTesting",0)s.print("NICK#{nick}",0)s.print("JOIN#{channel}",0)这个IRC机器人没有连接到IRC服务器,我做错了什么? 最佳答案 失败并显示此消息::irc.shakeababy.net461*USER:Notenoughparame

  10. ruby - 我正在学习编程并选择了 Ruby。我应该升级到 Ruby 1.9 吗? - 2

    我完全不是程序员,正在学习使用Ruby和Rails框架进行编程。我目前正在使用Ruby1.8.7和Rails3.0.3,但我想知道我是否应该升级到Ruby1.9,因为我真的没有任何升级的“遗留”成本。缺点是什么?我是否会遇到与普通gem的兼容性问题,或者甚至其他我不太了解甚至无法预料的问题? 最佳答案 你应该升级。不要坚持从1.8.7开始。如果您发现不支持1.9.2的gem,请避免使用它们(因为它们很可能不被维护)。如果您对gem是否兼容1.9.2有任何疑问,您可以在以下位置查看:http://www.railsplugins.or

随机推荐