zoukankan      html  css  js  c++  java
  • Android Runtime Stats

    Android 在 API 23 增加了运行时 GC 状态的获取接口,用法如下:

    Map<String, String> map = Debug.getRuntimeStats();
    String stat = Debug.getRuntimeStat("art.gc.gc-count");

    截止目前(API 28),能获取到的值如下表:

    运行时状态名称  含义  例子 
    art.gc.gc-count 当前进程的 GC 次数   164
    art.gc.gc-time 当前进程的 GC 总耗时,单位是毫秒 62364 
    art.gc.bytes-allocated 当前进程 art 虚拟机已分配的内存大小,单位字节  1463948408
    art.gc.bytes-freed 当前进程 GC 成功回收的字节数   1313493084
    art.gc.blocking-gc-count 当前进程的阻塞 GC 次数  2
    art.gc.blocking-gc-time 当前进程的阻塞 GC 总耗时,单位是毫秒  804
    art.gc.gc-count-rate-histogram  系统每10秒会计算一次 GC 次数,这个字段代表该进程运行到现在的每10秒 GC 次数的直方图。比如此例子中,意味着进程运行到现在有34503个的10秒内没有 GC 的情况,而有8个10秒内 GC 了5次的情况。  0:34503,1:45350,2:11281,3:8088,4:43,5:8
    art.gc.blocking-gc-count-rate-histogram  同上,不过是阻塞的 GC   0:99269,1:1,2:1
  • 相关阅读:
    Codeforces Round #609 (Div. 2)---C. Long Beautiful Integer
    Codeforces Round #609 (Div. 2)--B.Modulo Equality
    J
    G
    Convoy
    Farming Mars
    Java indexOf() 方法
    request.getContextPath()得到的是什么路径?
    OLAP、OLTP的介绍和比较
    Book recommendation
  • 原文地址:https://www.cnblogs.com/coding-way/p/8662546.html
Copyright © 2011-2022 走看看