Android内存使用——垃圾回收LOG,GC_CONCURRENT等的意义的说明
在调试程序的时候,经常发现GC_CONCURRENT之类的打印。在网上搜了一下,感觉说法各式各样。最后,在Google的官方网站上发现了详细介绍。
Every time a garbage collection occurs, logcat prints a message with the following information:
- GC Reason
- What triggered the garbage collection and what kind of collection it is. Reasons that may appearinclude:
GC_CONCURRENT- A concurrent garbage collection that frees up memory as your heap begins to fill up.
GC_FOR_MALLOC- A garbage collection caused because your app attempted to allocate memory when your heap wasalready full, so the system had to stop your app and reclaim memory.
GC_HPROF_DUMP_HEAP- A garbage collection that occurs when you create an HPROF file to analyze your heap.
GC_EXPLICIT- An explicit garbage collection, such as when you call
gc()(which youshould avoid calling and instead trust the garbage collector to run when needed). GC_EXTERNAL_ALLOC- This happens only on API level 10 and lower (newer versions allocate everything in the Dalvikheap). A garbage collection for externally allocated memory (such as the pixel data stored innative memory or NIO byte buffers).
- Amount freed
- The amount of memory reclaimed from this garbage collection.
- Heap stats
- Percentage free and (number of live objects)/(total heap size).
- External memory stats
- Externally allocated memory on API level 10 and lower (amount of allocated memory) / (limit atwhich collection will occur).
- Pause time
- Larger heaps will have larger pause times. Concurrent pause times show two pauses: one at thebeginning of the collection and another near the end.
For example:
Android内存使用——垃圾回收LOG,GC_CONCURRENT等的意义的说明的更多相关文章
- Android - 内存泄漏 + 垃圾回收(GC)概念
Android内存泄露——全解析和处理办法 内存泄露 说到内存泄露,就不得不提到内存溢出,这两个比较容易混淆的概念,我们来分析一下. 内存泄露:程序在向系统申请分配内存空间后(new),在使用完毕后未 ...
- Java进阶 JVM 内存与垃圾回收篇(一)
JVM 1. 引言 1.1 什么是JVM? 定义 Java Vritual Machine - java 程序的运行环境(Java二进制字节码的运行环境) 好处 一次编译 ,到处运行 自动内存管理,垃 ...
- Java内存与垃圾回收调优
Java(JVM)内存模型 正如你从上面的图片看到的,JVM内存被分成多个独立的部分.广泛地说,JVM堆内存被分为两部分——年轻代(Young Generation)和老年代(Old Generat ...
- 【转】Java内存与垃圾回收调优
要了解Java垃圾收集机制,先理解JVM内存模式是非常重要的.今天我们将会了解JVM内存的各个部分.如何监控以及垃圾收集调优. Java(JVM)内存模型 正如你从上面的图片看到的,JVM内存被分成多 ...
- 推荐收藏系列:一文理解JVM虚拟机(内存、垃圾回收、性能优化)解决面试中遇到问题(图解版)
欢迎一起学习 <提升能力,涨薪可待篇> <面试知识,工作可待篇 > <实战演练,拒绝996篇 > 欢迎关注我博客 也欢迎关注公 众 号[Ccww笔记],原创技术文章 ...
- python内存管理&垃圾回收
python内存管理&垃圾回收 引用计数器 环装双向列表refchain 在python程序中创建的任何对象都会放在refchain连表中 name = '张三' age = 18 hobby ...
- 【JVM之内存与垃圾回收篇】JVM与Java体系结构
JVM与Java体系结构 前言 作为Java工程师的你曾被伤害过吗?你是否也遇到过这些问题? 运行着的线上系统突然卡死,系统无法访问,甚至直接OOMM! 想解决线上JVM GC问题,但却无从下手. 新 ...
- <JVM上篇:内存与垃圾回收篇>01-JVM与Java体系结构
笔记来源:尚硅谷JVM全套教程,百万播放,全网巅峰(宋红康详解java虚拟机) 同步更新:https://gitee.com/vectorx/NOTE_JVM https://codechina.cs ...
- [CLR via C#]21. 自动内存管理(垃圾回收机制)
目录 理解垃圾回收平台的基本工作原理 垃圾回收算法 垃圾回收与调试 使用终结操作来释放本地资源 对托管资源使用终结操作 是什么导致Finalize方法被调用 终结操作揭秘 Dispose模式:强制对象 ...
随机推荐
- 解决Layui的switch样式显示问题
Layui官方文档是这么说的: <input type="checkbox" name="xxx" lay-skin="switch" ...
- git的常用操作指令
git学习网址: http://www.backlogtool.com/git-guide/cn/intro/intro2_3.html 廖雪峰的git教程 git的工作区和暂存区(描述git的工作流 ...
- 2017.10.3 QBXT 模拟赛
题目链接 T1 模拟 #include <cstring> #include <cstdio> #define N 105000 int L,R; char s[N]; int ...
- Elastic Search Java Api 创建索引结构,添加索引
创建TCP客户端 Client client = new TransportClient() .addTransportAddress(new InetSocketTransportAddress( ...
- 【转】实用API大全
有道翻译APIhttp://fanyi.youdao.com/openapi有道翻译API支持中英互译,同时获得有道翻译结果和有道词典结果(可能没有),返回格式为XML或JSON. 百度翻译APIht ...
- 第1节 flume:12、flume的load_balance实现机制
1.5.flume的负载均衡load balancer 负载均衡是用于解决一台机器(一个进程)无法解决所有请求而产生的一种算法.Load balancing Sink Processor 能够实现 l ...
- 《毛毛虫团队》第七次作业:团队项目设计完善&编码
一:实验名称:团队项目设计完善&编码 二:实验目的与要求 掌握软件编码实现的工程要求. 三:实验步骤 任务一:团队软件项目设计完善: 任务二:团队软件项目编码实现: 任务三:在团队博客发布博文 ...
- Factorialize a Number-freecodecamp算法题目
Factorialize a Number(计算一个整数的阶乘) 要求 给定一个整数,求其阶乘(用字母n来代表一个整数,阶乘代表着所有小于或等于n的整数的乘积) 思路 确定乘的次数 用for循环进行累 ...
- C#基础-循环语句
while语句 int i = 1,sum=0; while (i <= 100) { sum += i; i++; } Console.WriteLine(sum); do···while语句 ...
- Python的ORM介绍
实现方法: SQLOject peewee Django's ORM SQLAlchemy