zoukankan      html  css  js  c++  java
  • Lost RAM的统计方法

    最近遇到一个Lost RAM占用内存达到1.5GB的问题,所以先统计一下Lost RAM的计算方法:

    根据计算公式:

                long lostRAM = memInfo.getTotalSizeKb() - (totalPss - totalSwapPss)
                        - memInfo.getFreeSizeKb() - memInfo.getCachedSizeKb()
                        - memInfo.getKernelUsedSizeKb() - memInfo.getZramTotalSizeKb();

    解读:

    Lost RAM=total memory(减掉kernel reserve部分)-(process total pss - swap占用空间总和(除去native process所占用swap空间))-dumpsys meminfo(free+cached kernel+kernel+ZRAM used见下文) 

    即:Lost ram=883248-(193417+476988-74453)-(64008+81368+100892+59368)=-18340

    Total RAM:   883,248K (status normal)
     Free RAM:   338,793K (  193,417K cached pss +    81,368K cached kernel +    64,008K free)
     Used RAM:   577,880K (  476,988K used pss +   100,892K kernel)
     Lost RAM:   -18,340K
         ZRAM:    59,368K physical used for   179,388K in swap (  661,184K total swap)
       Tuning: 128 (large 256), oom   184,320K, restore limit    61,440K (low-ram)
  • 相关阅读:
    截图插件
    断点续传
    sql server 将日期减一天
    C# 输出24小时格式时间
    蓝桥 凑平方数
    九宫重排
    HDU 1584
    HDU 2612 (两边一起)
    HDU 1016 Prime Ring Problem
    全排列、排列、排列组合
  • 原文地址:https://www.cnblogs.com/onelikeone/p/12553876.html
Copyright © 2011-2022 走看看