由于linux内核和native service使用的内存在settings中统计不出来,因此对于分析内存相关问题时,使用procrank命令则能比较清晰的获取每个进程占用的内存资源
$adb shell procrank
PID Vss Rss Pss Uss cmdline119 280K 272K 74K 68K /system/bin/debuggerd
使用adb shell dumpsys meminfo或ddms工具的dump device state也能统计内存信息
Applications Memory Usage (kB):
Uptime: 10092666 Realtime: 143044833
** MEMINFO in pid 274 [com.google.process.gapps] **
native dalvik other total
size: 4848 6855 N/A 11703
allocated: 4535 4071 N/A 8606
free: 176 2784 N/A 2960
(Pss): 2613 1239 7757 11609
(shared dirty): 584 1272 5404 7260
(priv dirty): 2588 1180 3940 7708
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 5 AssetManagers: 5
Local Binders: 25 Proxy Binders: 30
Death Recipients: 1
OpenSSL Sockets: 5
SQL
heap: 409 MEMORY_USED: 409
PAGECACHE_OVERFLOW: 92 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 7 38 googlesettings.db
1 33 66 gservices.db
1 24 116 talk.db
1 11 0 (attached) transient_talk_db
1 11 143 subscribedfeeds.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 236 [com.android.phone] **
native dalvik other total
size: 6656 6919 N/A 13575
allocated: 5581 3847 N/A 9428
free: 538 3072 N/A 3610
(Pss): 2899 967 8039 11905
(shared dirty): 752 1532 5468 7752
(priv dirty): 2864 896 5148 8908
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 5 AssetManagers: 5
Local Binders: 39 Proxy Binders: 46
Death Recipients: 2
OpenSSL Sockets: 0
SQL
heap: 1012 MEMORY_USED: 1012
PAGECACHE_OVERFLOW: 68 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 5 176 btopp.db
1 73 500 mmssms.db
1 4 82 telephony.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/Phone.apk:/resources.arsc: 178K
zip:/system/app/Bluetooth.apk:/resources.arsc: 267K
zip:/system/app/TelephonyProvider.apk:/resources.arsc: 1K
zip:/system/app/Stk.apk:/resources.arsc: 7K
** MEMINFO in pid 228 [com.baidu.input] **
native dalvik other total
size: 7608 5895 N/A 13503
allocated: 7304 2855 N/A 10159
free: 3 3040 N/A 3043
(Pss): 823 429 6569 7821
(shared dirty): 796 1840 5784 8420
(priv dirty): 784 144 5764 6692
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 14 Proxy Binders: 21
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/data/app/com.baidu.input-1.apk:/resources.arsc: 13K
** MEMINFO in pid 159 [system] **
native dalvik other total
size: 10072 8583 N/A 18655
allocated: 9125 5721 N/A 14846
free: 198 2862 N/A 3060
(Pss): 4563 1575 15043 21181
(shared dirty): 572 1200 5472 7244
(priv dirty): 4536 1520 10256 16312
Objects
Views: 0 ViewRoots: 0
AppContexts: 2 Activities: 0
Assets: 12 AssetManagers: 12
Local Binders: 139 Proxy Binders: 241
Death Recipients: 110
OpenSSL Sockets: 0
SQL
heap: 206 MEMORY_USED: 206
PAGECACHE_OVERFLOW: 45 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 25 82 settings.db
1 19 122 accounts.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/SettingsProvider.apk:/resources.arsc: 4K
zip:/system/app/DeskClock.apk:/resources.arsc: 28K
zip:/system/app/Settings.apk:/resources.arsc: 326K
zip:/system/app/Browser.apk:/resources.arsc: 91K
zip:/system/app/Mms.apk:/resources.arsc: 100K
zip:/system/app/SenseUI.apk:/resources.arsc: 193K
zip:/system/app/Phone.apk:/resources.arsc: 178K
zip:/system/app/Contacts.apk:/resources.arsc: 983K
** MEMINFO in pid 259 [android.process.acore] **
native dalvik other total
size: 6544 6535 N/A 13079
allocated: 6457 3718 N/A 10175
free: 78 2817 N/A 2895
(Pss): 3218 576 6459 10253
(shared dirty): 740 1568 5552 7860
(priv dirty): 3184 504 4468 8156
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 5 AssetManagers: 5
Local Binders: 14 Proxy Binders: 86
Death Recipients: 2
OpenSSL Sockets: 0
SQL
heap: 1080 MEMORY_USED: 1080
PAGECACHE_OVERFLOW: 267 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 401 500 contacts2.db
1 9 0 (attached) presence_db
1 16 50 :memory:
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/ContactsProvider.apk:/resources.arsc: 2K
zip:/system/app/ApplicationsProvider.apk:/resources.arsc: 10K
zip:/system/app/UserDictionaryProvider.apk:/resources.arsc: 1K
zip:/system/app/Contacts.apk:/resources.arsc: 983K
** MEMINFO in pid 404 [com.cyanogenmod.cmparts] **
native dalvik other total
size: 3052 5639 N/A 8691
allocated: 3023 2743 N/A 5766
free: 8 2896 N/A 2904
(Pss): 439 201 2289 2929
(shared dirty): 876 1816 5972 8664
(priv dirty): 388 112 1568 2068
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 2 Proxy Binders: 5
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/CMParts.apk:/resources.arsc: 297K
** MEMINFO in pid 288 [com.android.settings] **
native dalvik other total
size: 10708 6599 N/A 17307
allocated: 5315 3731 N/A 9046
free: 2316 2868 N/A 5184
(Pss): 3063 597 5537 9197
(shared dirty): 752 1560 5612 7924
(priv dirty): 3028 524 3720 7272
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 12 Proxy Binders: 24
Death Recipients: 2
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/Settings.apk:/resources.arsc: 326K
** MEMINFO in pid 246 [android.process.acore] **
native dalvik other total
size: 9588 6087 N/A 15675
allocated: 6241 3335 N/A 9576
free: 702 2752 N/A 3454
(Pss): 2787 502 5762 9051
(shared dirty): 756 1712 5520 7988
(priv dirty): 2752 420 3936 7108
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 3 AssetManagers: 3
Local Binders: 18 Proxy Binders: 20
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 73 MEMORY_USED: 73
PAGECACHE_OVERFLOW: 5 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 5 62 launcher.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/SenseUI.apk:/resources.arsc: 193K
** MEMINFO in pid 385 [com.android.mms] **
native dalvik other total
size: 5620 7367 N/A 12987
allocated: 5016 4486 N/A 9502
free: 131 2881 N/A 3012
(Pss): 2097 689 8132 10918
(shared dirty): 664 1592 5452 7708
(priv dirty): 2068 616 5960 8644
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 19 Proxy Binders: 33
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/Mms.apk:/resources.arsc: 100K
** MEMINFO in pid 713 [com.antutu.MmsExtra] **
native dalvik other total
size: 3884 5895 N/A 9779
allocated: 3412 2970 N/A 6382
free: 131 2925 N/A 3056
(Pss): 1154 416 3753 5323
(shared dirty): 792 1668 5660 8120
(priv dirty): 1116 336 2428 3880
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 6 Proxy Binders: 15
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 344 [android.process.media] **
native dalvik other total
size: 3400 5703 N/A 9103
allocated: 3365 2915 N/A 6280
free: 22 2788 N/A 2810
(Pss): 1112 266 2672 4050
(shared dirty): 844 1788 5856 8488
(priv dirty): 1068 180 1652 2900
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 4 AssetManagers: 4
Local Binders: 5 Proxy Binders: 10
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 439 MEMORY_USED: 439
PAGECACHE_OVERFLOW: 174 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 210 72 external-19161ef1.db
1 55 39 internal.db
1 8 116 downloads.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/DownloadProvider.apk:/resources.arsc: 9K
zip:/system/app/MediaProvider.apk:/resources.arsc: 2K
zip:/system/app/DrmProvider.apk:/resources.arsc: 3K
** MEMINFO in pid 444 [com.google.android.apps.uploader] **
native dalvik other total
size: 2820 5639 N/A 8459
allocated: 2698 2788 N/A 5486
free: 5 2851 N/A 2856
(Pss): 476 194 2029 2699
(shared dirty): 804 1832 5964 8600
(priv dirty): 432 104 1304 1840
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 4 Proxy Binders: 6
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 421 [com.dolphin.browser.cn] **
native dalvik other total
size: 3860 6535 N/A 10395
allocated: 3457 3487 N/A 6944
free: 6 3048 N/A 3054
(Pss): 873 739 5472 7084
(shared dirty): 696 1720 5744 8160
(priv dirty): 840 656 2952 4448
Objects
Views: 0 ViewRoots: 0
AppContexts: 1 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 7 Proxy Binders: 9
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 114 MEMORY_USED: 114
PAGECACHE_OVERFLOW: 56 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 64 17 emotion.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/DolphinBrowser_CN_gaoy04_signed.apk:/resources.arsc: 387K
** MEMINFO in pid 328 [com.android.providers.calendar] **
native dalvik other total
size: 3244 5575 N/A 8819
allocated: 2992 2881 N/A 5873
free: 11 2694 N/A 2705
(Pss): 736 224 2430 3390
(shared dirty): 844 1816 5892 8552
(priv dirty): 692 136 1544 2372
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 4 Proxy Binders: 8
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 151 MEMORY_USED: 151
PAGECACHE_OVERFLOW: 23 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 33 337 calendar.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/CalendarProvider.apk:/resources.arsc: 29K
** MEMINFO in pid 434 [com.cooliris.media] **
native dalvik other total
size: 3156 5767 N/A 8923
allocated: 2883 2882 N/A 5765
free: 8 2885 N/A 2893
(Pss): 691 259 2679 3629
(shared dirty): 776 1800 5816 8392
(priv dirty): 652 172 1700 2524
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 2 Proxy Binders: 7
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 64 MEMORY_USED: 64
PAGECACHE_OVERFLOW: 5 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 10 10 picasa.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/Gallery3D.apk:/resources.arsc: 20K
** MEMINFO in pid 357 [com.android.deskclock] **
native dalvik other total
size: 3352 5639 N/A 8991
allocated: 3256 2892 N/A 6148
free: 47 2747 N/A 2794
(Pss): 941 296 3022 4259
(shared dirty): 780 1756 5616 8152
(priv dirty): 904 212 2104 3220
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 3 AssetManagers: 3
Local Binders: 6 Proxy Binders: 18
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 66 MEMORY_USED: 66
PAGECACHE_OVERFLOW: 4 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 4 54 alarms.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/DeskClock.apk:/resources.arsc: 28K
zip:/system/app/DeskClock.apk:/assets/fonts/Clockopia.ttf: 7K
** MEMINFO in pid 669 [com.android.browser] **
native dalvik other total
size: 4048 5703 N/A 9751
allocated: 3888 3019 N/A 6907
free: 155 2684 N/A 2839
(Pss): 1589 395 5347 7331
(shared dirty): 724 1732 5536 7992
(priv dirty): 1556 312 2484 4352
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 6 Proxy Binders: 14
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 342 MEMORY_USED: 342
PAGECACHE_OVERFLOW: 33 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 14 32 webview.db
1 6 46 webviewCache.db
1 5 41 browser.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/Browser.apk:/resources.arsc: 91K
** MEMINFO in pid 645 [com.google.android.googlequicksearchbox] **
native dalvik other total
size: 4608 6087 N/A 10695
allocated: 3718 3141 N/A 6859
free: 97 2946 N/A 3043
(Pss): 1530 657 4326 6513
(shared dirty): 668 1568 5480 7716
(priv dirty): 1500 584 2796 4880
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 9 Proxy Binders: 18
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 112 MEMORY_USED: 112
PAGECACHE_OVERFLOW: 18 MALLOC_SIZE: 50
DATABASES
pgsz dbsz Lookaside(b) Dbname
1 15 151 qsb-log.db
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 369 [com.cyanogenmod.android.fotakill] **
native dalvik other total
size: 2820 5511 N/A 8331
allocated: 2661 2756 N/A 5417
free: 2 2755 N/A 2757
(Pss): 344 146 1526 2016
(shared dirty): 916 1880 6024 8820
(priv dirty): 284 48 1036 1368
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 1 Proxy Binders: 6
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 412 [com.noshufou.android.su] **
native dalvik other total
size: 3280 5639 N/A 8919
allocated: 3265 2998 N/A 6263
free: 6 2641 N/A 2647
(Pss): 908 198 2856 3962
(shared dirty): 804 1832 5792 8428
(priv dirty): 868 104 1828 2800
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 3 AssetManagers: 3
Local Binders: 5 Proxy Binders: 9
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 314 [zhangjia1936.autoswapon] **
native dalvik other total
size: 2820 5575 N/A 8395
allocated: 2674 2701 N/A 5375
free: 5 2874 N/A 2879
(Pss): 363 179 1704 2246
(shared dirty): 912 1848 5996 8756
(priv dirty): 304 84 1232 1620
Objects
Views: 0 ViewRoots: 0
AppContexts: 0 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 1 Proxy Binders: 5
Death Recipients: 0
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
** MEMINFO in pid 219 [com.android.systemui] **
native dalvik other total
size: 5128 6855 N/A 11983
allocated: 4400 3851 N/A 8251
free: 199 3004 N/A 3203
(Pss): 1757 610 4767 7134
(shared dirty): 764 1584 5584 7932
(priv dirty): 1720 536 3684 5940
Objects
Views: 0 ViewRoots: 0
AppContexts: 4 Activities: 0
Assets: 2 AssetManagers: 2
Local Binders: 34 Proxy Binders: 27
Death Recipients: 1
OpenSSL Sockets: 0
SQL
heap: 0 MEMORY_USED: 0
PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Asset Allocations
zip:/system/framework/framework-res.apk:/resources.arsc: 404K
zip:/system/app/SystemUI.apk:/resources.arsc: 28K