垃圾收集如何在Android 4.2 Jelly bean Dalvik VM中工作? [英] How does garbage collection work in Android 4.2 Jelly bean Dalvik VM?

查看:119
本文介绍了垃圾收集如何在Android 4.2 Jelly bean Dalvik VM中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:这句话在android 2.3中,并发标记和清除用于与堆栈相关的对象,将所有内容都视为指针,而复制垃圾回收用于堆中的对象是否正确?有人可以解释吗? android 2.3中的垃圾收集器

Edit : Is this statement "So in android 2.3 concurrent mark and sweep is used for stack related objects treating everything as pointer and copying garbage collection is used for the objects in the heap" correct ? Any one can explain ? garbage collector in android 2.3

我知道已经讨论过 Android垃圾收集的主题,但是我找不到关于其工作原理的清晰详细的解释,尤其是在最新版本的Android中,果冻豆4.2

I know the subject of Garbage Collection in Android has been discussed, but I can't find a clear and detailed explanation of how it works and specially in the last version of Android which is Jelly Bean 4.2.

除了主要问题外,我还有两个更具体的问题:

In addition to the main question I have two more specific questions :

1)实施了哪些算法(标记和扫描,并发标记和扫描,复制,分代,增量..)以及如何对其进行了调整到实际的Android / Dalvik 吗?

1) Which algorithms (Mark and Sweep, Concurrent Mark and Sweep, Copying, generational, incremental..) are implemented and how have they been adapted to actual Android/Dalvik ?

2)作为我的初学者,我怎么能自己分解其工作原理 (方法或工具)?

2) As I am beginner, how can I by my self break down how it works (methodology or tools) ?

任何输入都会受到赞赏。

Any input is appreciated.

推荐答案

Dalvik的垃圾收集器还没有' t自Gingerbread(2.3)以来发生了显着变化,因此您可以找到该时代或更新版本的任何信息都可能适用于豆形软糖。

Dalvik's garbage collector hasn't changed significantly since Gingerbread (2.3), so any information you can find of that era or newer will likely apply to Jellybean.

它使用并发标记扫方法。它不会复制或压缩,并且具有几代的概念(对合子分配的内存进行了优化)。

It uses a concurrent mark-and-sweep approach. It doesn't copy or compact, and has a slight notion of generations (optimizations for memory allocated by the zygote).

了解其工作方式的最佳方法是:阅读资料。大多数相关代码都位于 dalvik / vm / alloc 中。

The best way to understand how it works is to read the sources. Most of the relevant code lives in dalvik/vm/alloc.

这篇关于垃圾收集如何在Android 4.2 Jelly bean Dalvik VM中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆