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模式:强制对象 ...
随机推荐
- C语言中字符串数组的遍历和比较
/* The list of known types of default packet. */static char *_default_packet_types[] = { "d ...
- 似水流年 ? Chrome调试大全
http://www.360doc.com/content/12/1107/20/7851074_246467307.shtml 作为一名前端开发者,打交道最多的可能是和浏览器.市面上各种浏览器多 ...
- JavaScript实现页面到滚动到指定位置执行某些操作
比如 页面中 某个DOM, 希望点击按钮后页面直接跳转到 这个DOM所在的位置, 1. 获取DOM离屏幕的高度 var hTop = $('#box').offset().top; $('body,h ...
- DROP OPERATOR - 删除一个操作符
SYNOPSIS DROP OPERATOR name ( lefttype | NONE , righttype | NONE ) [ CASCADE | RESTRICT ] DESCRIPTIO ...
- C# Dictionary 的几种遍历方法,排序
Dictionary<string, int> list = new Dictionary<string, int>(); list.Add(); //3.0以上版本 fore ...
- Java多线程 编写三各类Ticket、SaleWindow、TicketSaleCenter分别代表票信息、售票窗口、售票中心。 售票中心分配一定数量的票,由若干个售票窗口进行出售,利用你所学的线程知识来模拟此售票过程。
package com.swift; import java.util.ArrayList; import java.util.HashMap; import java.util.List; impo ...
- cocos2dx 加密spine文件遇到的问题(暂时没有解决方法)
今天我研究了一下加密spine动画的加密的方法,图片肯定要加密的,所以我只选择加密图片,另外的一个altas文件和json文件就不做加密打算. 我的思路是通过TexturePacker打包成加密的文件 ...
- ARC中__weak;__strong;__unsafe_unretained;修饰词
测试代码: // Human.h代码 @interface Human : NSObject @property (nonatomic, weak) Cat *pinkCat; @property ( ...
- 一些恶搞人的c++程序
top1: 不停打开的cmd(磁盘操作系统) 代码如下: #include<windows.h> using namespace std; int main() { system(&quo ...
- Linux基础学习-用户的创建修改删除
用户添加修改删除 1 useradd添加用户 添加一个新用户hehe,指定uid为3000,家目录为/home/haha [root@qdlinux ~]# useradd -u 3000 -d /h ...