How to check memory leakage from message log in Lo

2019-03-31 03:27发布

问题:

This is my log

01-13 14:37:50.634: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 86K, 50% free 2735K/5379K, external 0K/0K, paused 29ms
01-13 14:37:50.765: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:37:50.765: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:37:50.765: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:37:50.765: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:37:50.785: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:37:50.785: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:37:50.785: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:37:50.785: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:37:50.845: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:37:50.845: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:37:50.855: I/[POST_RESELECT](27390): [handleTextChanged] (start,before,after)=(0,0,4)
01-13 14:37:50.855: I/[POST_RESELECT](27390): [handleTextChanged] (start,before,after)=(0,0,3)
01-13 14:37:51.986: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:37:51.986: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:37:52.676: D/dalvikvm(27390): GC_CONCURRENT freed 121K, 47% free 3009K/5639K, external 1850K/2199K, paused 2ms+2ms
01-13 14:37:53.307: E/[JsonHelper]getJsonArrayFromUrlWithData(String url, List<NameValuePair> datas)(27390): Error converting data org.json.JSONException: Value null of type org.json.JSONObject$1 cannot be converted to JSONArray
01-13 14:37:54.538: D/dalvikvm(27390): GC_CONCURRENT freed 393K, 47% free 3377K/6279K, external 2003K/2199K, paused 2ms+3ms
01-13 14:37:54.698: D/dalvikvm(27390): GC_CONCURRENT freed 728K, 48% free 3615K/6855K, external 2003K/2199K, paused 2ms+3ms
01-13 14:37:54.798: D/dalvikvm(27390): GC_CONCURRENT freed 973K, 49% free 3689K/7175K, external 2003K/2199K, paused 2ms+2ms
01-13 14:37:54.989: I/MapActivity(27390): Handling network change notification:CONNECTED
01-13 14:37:54.989: E/MapActivity(27390): Couldn't get connection factory client
01-13 14:37:59.933: D/LocationManager(27390): _handleMessage: TYPE_LOCATION_CHANGED
01-13 14:38:01.045: D/dalvikvm(27390): GC_CONCURRENT freed 708K, 46% free 3902K/7175K, external 2009K/2199K, paused 2ms+5ms
01-13 14:38:05.399: V/(PlaceActionActivity)(27390): I'm paused!
01-13 14:38:06.750: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 574K, 44% free 4255K/7495K, external 1182K/1846K, paused 51ms
01-13 14:38:07.741: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 308K, 46% free 4053K/7495K, external 1182K/1182K, paused 32ms
01-13 14:38:07.851: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 45K, 46% free 4047K/7495K, external 2206K/2755K, paused 31ms
01-13 14:38:08.992: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 125K, 46% free 4064K/7495K, external 3230K/3230K, paused 29ms
01-13 14:38:09.102: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 71K, 46% free 4089K/7495K, external 4254K/4254K, paused 29ms
01-13 14:38:10.013: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 228K, 47% free 4082K/7559K, external 6558K/6592K, paused 30ms
01-13 14:38:10.113: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 106K, 46% free 4104K/7559K, external 4741K/5313K, paused 29ms
01-13 14:38:10.233: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 100K, 46% free 4129K/7559K, external 7045K/7199K, paused 29ms
01-13 14:38:11.375: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 252K, 46% free 4100K/7559K, external 8555K/9085K, paused 30ms
01-13 14:38:11.495: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 145K, 46% free 4154K/7559K, external 5739K/5920K, paused 29ms
01-13 14:38:11.585: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 68K, 45% free 4174K/7559K, external 6993K/7455K, paused 29ms
01-13 14:38:11.835: D/dalvikvm(27390): GC_FOR_MALLOC freed 279K, 46% free 4083K/7559K, external 8990K/10012K, paused 28ms
01-13 14:38:12.045: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 61K, 46% free 4093K/7559K, external 3179K/3970K, paused 30ms
01-13 14:38:12.145: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 69K, 46% free 4117K/7559K, external 5227K/5249K, paused 34ms
01-13 14:38:12.255: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 135K, 45% free 4177K/7559K, external 6456K/6847K, paused 35ms
01-13 14:38:12.386: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 166K, 45% free 4215K/7623K, external 9246K/9341K, paused 31ms
01-13 14:38:12.886: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 270K, 46% free 4131K/7623K, external 11524K/11524K, paused 30ms
01-13 14:38:12.996: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 149K, 46% free 4177K/7623K, external 6456K/6847K, paused 30ms
01-13 14:38:13.126: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 166K, 45% free 4216K/7623K, external 9246K/9341K, paused 30ms
01-13 14:38:13.547: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 270K, 46% free 4132K/7623K, external 11524K/11524K, paused 30ms
01-13 14:38:13.667: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 149K, 46% free 4145K/7623K, external 6200K/6847K, paused 30ms
01-13 14:38:13.797: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 134K, 45% free 4214K/7623K, external 8990K/9021K, paused 32ms
01-13 14:38:14.207: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 268K, 46% free 4119K/7623K, external 10500K/11294K, paused 30ms
01-13 14:38:14.348: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 183K, 46% free 4178K/7623K, external 6456K/6528K, paused 31ms
01-13 14:38:14.598: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 166K, 45% free 4217K/7623K, external 9246K/9341K, paused 37ms
01-13 14:38:15.078: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 278K, 46% free 4121K/7623K, external 11524K/11524K, paused 30ms
01-13 14:38:15.188: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 146K, 46% free 4132K/7623K, external 6200K/6847K, paused 43ms
01-13 14:38:15.369: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 166K, 46% free 4170K/7623K, external 8990K/9021K, paused 36ms
01-13 14:38:16.249: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 213K, 47% free 4053K/7623K, external 11218K/11268K, paused 31ms
01-13 14:38:16.390: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 54K, 47% free 4089K/7623K, external 5666K/5910K, paused 30ms
01-13 14:38:17.791: V/(PlaceActivityActivity)(27390): I'm paused!
01-13 14:38:17.841: I/MapActivity(27390): Handling network change notification:CONNECTED
01-13 14:38:17.851: W/IdleConnectionHandler(27390): Removing a connection that never existed!
01-13 14:38:17.851: W/IdleConnectionHandler(27390): Removing a connection that never existed!
01-13 14:38:17.871: V/(PlaceActionActivity)(27390): I'm destroyed!
01-13 14:38:17.871: V/(PlaceActivityActivity)(27390): I'm destroyed!
01-13 14:38:19.222: D/dalvikvm(27390): GC_EXTERNAL_ALLOC freed 197K, 48% free 3983K/7623K, external 4692K/5859K, paused 31ms
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:38:19.292: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:38:19.332: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@4013a5d0,-1,0,-1,0)
01-13 14:38:19.332: I/[POST_RESELECT](27390): [spanChange] (o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4013d9a0,-1,0,-1,0)
01-13 14:38:19.332: I/[POST_RESELECT](27390): [handleTextChanged] (start,before,after)=(0,0,4)
01-13 14:38:19.332: I/[POST_RESELECT](27390): [handleTextChanged] (start,before,after)=(0,0,3)

I wonder if anyone could walk me through this line:

GC_EXTERNAL_ALLOC freed 574K, 44% free 4255K/7495K, external 1182K/1846K, paused 51ms

What does this number 4255K/7495K telling us?

回答1:

Someone recently pointed me to an Eclipse plugin that (after briefly glancing over it) seems to be very effective at spotting memory leaks. Try the Eclipse Memory Analyzer Open Source Project. You can click "Dump HPROF file" under "Devices" tab in DDMS and get info/graphical charts of your heap information. It looks really neat.

BTW, it seems that the numbers you are questioning are the available/capacity of the applications heap size. GC_EXTERNAL_ALLOC is described more in this post.