Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1406945
  • 博文数量: 478
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 4833
  • 用 户 组: 普通用户
  • 注册时间: 2014-06-28 11:12
文章分类

全部博文(478)

文章存档

2019年(1)

2018年(27)

2017年(21)

2016年(171)

2015年(258)

我的朋友

分类: Android平台

2015-10-17 16:58:21

[FAQ04354]一些查看内存状况的adb command
2015-10-08
软件分支GB3JB2JB3JB5...
FAQs 5 of 15
如何查找Modem/Kernel/FrameBuffer Footprint? 如何关闭zram(内存压缩)以测试系统性能

内容

请参考下面的1)2)3)抓取对应的信息,若需要MTK协助,请提供下面的信息,并将mtklog文件夹也一并附上
 
   1) Use adb shell cat /proc/meminfo to calculate the free memory, as usual the free memory is  MemFree + cached
      taking the follow example, te free memory is 5616K + 158632K
        cat proc/meminfo
          MemTotal:         483724 kB
         
 MemFree:            5616 kB
          Buffers:            2732 kB
          Cached:           158632 kB
          SwapCached:            0 kB
          Active:           277336 kB
          Inactive:          83232 kB
         Active(anon):     197452 kB
       Attention,in the phone menu setting->apps->running app, the free memory is MemFree + cached + background running app memory - SECOND_SERVER_MEM,you can refer to the follwoing for details:the function void refreshUi(boolean dataChanged) in RunningProcessView.java(/alps/package/apps/settings/src/com/android/setting/applications) (Related FAQ09452How to calculate cached free memory?)

   2) Use adb shell procrank (Just ENGload) to find which process consume most memory, please refer to PSS
 
     adb shell procrank
       PID      Vss      Rss      Pss      Uss  cmdline
       476   65312K   65284K   38499K   35560K  com.android.launcher
      268   54916K   54880K   30001K   27000K  system_server
      110   32196K   28988K   18924K   12432K  /system/bin/surfaceflinger
      347   42400K   42320K   15445K   10704K  com.android.systemui
 

   3) For the process in 2) who consume most memory, use adb shell showmap [pid] (Just ENG load) to more details.  Take system_server for example, first get the pid by adb shell ps system_server:
    adb shell ps system_server
         USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
        system    268   111   406736 54876 ffffffff 400e9c70 S system_server
  
   Then  adb shell showmap 268 to find every .so and heap, stack memory consume.  Refer to the PSS
     adb shell showmap 268
       virtual                     shared   shared  private  private
         size      RSS      PSS    clean    dirty    clean    dirty    # object
    -------- -------- -------- -------- -------- -------- -------- ---- ------------------------------
         72       20       20        0        0       20        0    1 
/data/dalvik-cache/system@app@SettingsProvider.apk@classes.dex
         352      148      103       32       16       48       52   18 /data/dalvik-cache/system@framework@android.policy.jar@classes.dex
        1348       28        8       20        0        8        0    1 /data/dalvik-cache/system@framework@apache-xml.jar@classes.dex
         956       60       13       52        0        8        0    1 /data/dalvik-cache/system@framework@bouncycastle.jar@classes.dex
         24        8        0        8        0        0        0    1 /data/dalvik-cache/system@framework@core-junit.jar@classes.dex
        3292     1056      126     1012        0       44        0    1 /data/dalvik-cache/system@framework@core.jar@classes.dex
 
 
其它内存相关FAQ,欢迎访问
FAQ04223如何查看Modem/Kernel/FrameBuffer的Footprint?
FAQ04354内存不足时查看内存使用情况的一些adb command
FAQ07759如何查看当前项目的physical memory layout
FAQ07760如何查看当前项目的virtual memory layout
FAQ09452手机cached free memory(剩余内存)计算方法
FAQ09454如何计算开机之后留给Linux Kernel可用的总内存
FAQ09456zram(内存压缩)介绍
FAQ10389如何关闭 zram/swap功能
 
阅读(653) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~