对于个人资料的详细解释从"亚行外壳dumpsys meminfo中我-APP-名称和QUOT;? [英] Detailed explanation for profile from "adb shell dumpsys meminfo my-app-name"?

查看:251
本文介绍了对于个人资料的详细解释从"亚行外壳dumpsys meminfo中我-APP-名称和QUOT;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能给我关于通过得到的配置文件的详细说明亚行外壳dumpsys meminfo中我-APP-名称

Can anyone give me a detailed explanation about the profile gotten by adb shell dumpsys meminfo my-app-name?

其结果是一样以下,因为它在<一个提到href="http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android">How发现我在Android中应用程序的内存使用情况:

The result is just as below as it mentioned in How to discover memory usage of my application in Android:

** MEMINFO in pid 890 [process-name] **
                    native   dalvik    other    total
            size:    10940     7047      N/A    17987
       allocated:     8943     5516      N/A    14459
            free:      336     1531      N/A     1867
           (Pss):     4585     9282    11916    25783
  (shared dirty):     2184     3596      916     6696
    (priv dirty):     4504     5956     7456    17916

 Objects
           Views:      149        ViewRoots:        4
     AppContexts:       13       Activities:        0
          Assets:        4    AssetManagers:        4
   Local Binders:      141    Proxy Binders:      158
Death Recipients:       49
 OpenSSL Sockets:        0

 SQL
            heap:      205          dbFiles:        0
       numPagers:        0   inactivePageKB:        0
    activePageKB:        0

什么是每一列(本机,Dalvik的,其他的,总计)是什么意思?特别是什么是其他一栏(我想不出有什么,除了本地和Dalvik的)? 这将是巨大的,如果有人可以给一个具体的例子来阐述这个问题。 例如我有一个应用程序答:有自己的对象obj_private和自己的本机库lib_private。此外,A引用Android框架obj_shared和Android框架的某些本地库的某些对象lib_shared。而obj_shared参考Android的lib_shared_indirect一些本地库。对于这种情况,我只能说这些?

What does the each column (native, dalvik, other, total) mean? especially what's the "other" column (I can't figure out what's that besides native and dalvik)? It would be great if someone can give a concrete example to elaborate about this. e.g. I have an app A. A has its own object obj_private and its own native library lib_private. Besides, A references some object of Android framework obj_shared and some native lib of Android framework lib_shared. And obj_shared reference some native lib of Android lib_shared_indirect. For this case, can I say those?

  1. 在累计大小等同采用obj_private + lib_private + obj_shared + lib_shared + lib_shared_indirect所有的记忆。
  2. 在私有脏等于内存弄脏obj_private + lib_private

我们要清楚这一点的理由是:有我们的最新版本的应用程序的一些不寻常的运行时内存相比增长previous版本。而当我用dumpsys meminfo中,我发现了列本土和其他急剧增加。但新版本的变化只涉及到Java并没有解释这其他一栏。我GOOGLE了这一点,并没有发现任何文件。我也试图读取亚行的源$ C ​​$ C。但我发现很容易迷失在源$ C ​​$ C,适合新手和我一样。所以我在这里发布的情况下,一些人可以帮助这个问题。

The reason we want to make clear about this is: there are some unusual runtime-memory increase of our latest version app compared to previous version. And when I used the dumpsys meminfo, I found the columns "native" and "other" increased dramatically. But the change of the new version is only related to java and there is no explain about the "other" column. I googled this and found no document. I also tried to read the source code of the adb. But I found it's easy to get lost in the source code for novice like me. So I post this question here in case that some one can help.

推荐答案

我们现在有更多的文件覆盖了Android的RAM使用该进入一些细节什么不同的RAM数字含义:的Managing~~V您的应用程序的内存。特别是,看看在页面中间这里讨论meminfo中转储的关键部分:调查您RAM使用

We now have more documentation covering RAM use in Android that goes into some detail about what different RAM numbers mean: Managing Your App's Memory. In particular, have a look at the middle of the page here that discusses key parts of the meminfo dump: Investigating Your RAM Usage.

它看起来像你的meminfo中的输出是一个相当老版本的Andr​​oid,之前,我们可以找出许多不同类型分配的。要映射您所看到的当前文档什么,只是认为其他是一切现代转储显示,除了本地和Dalvik的部分。在你的场,我相信你的Dalvik的部分实际上是现代的Dalvik的堆和Dalvik的其他放在一起。

It looks like your meminfo output is from a fairly old version of Android, before we could identify many of the different types of allocations. To map what you are seeing to the current documentation, just consider "other" to be everything that the modern dump shows besides the native and dalvik sections. In your dump, I believe your dalvik section is actually the modern "Dalvik Heap" and "Dalvik Other" put together.

至于本地等板块之后,越来越多地在Java code只有一个变化,是的,这当然可以发生。一个数字的机器人的Java API的份坐在本地分配的顶部,并且也可引起其他分配。这个经典的例子是位图的姜饼和更早版本,其中,位图数据是本机的分配,而不是在Java堆的数组分配,因为它是今天。

As far as the native and other sections increasingly after only a change in the Java code, yes this can certainly happen. A number of parts of the Android Java API sits on top of native allocations, and can also cause other allocations. The classic example of this would be bitmaps on Gingerbread and earlier, where the data for the bitmap was a native allocation rather than being an array allocations in the Java heap as it is today.

您增加其他分配可能是由于一些事情,你会看到列出的数据的较新版本 - 内存的支持光标,从ashmem共享内存区域,设备分配你的东西,例如图形纹理等,有这么多的东西可能很难说什么可能是怎么回事,这就是为什么该报告更详细的这些日子。 (即使有,我们还有许多事情得到晕倒在未知的。)

Your increased other allocations can be due to a number of things as you will see listed in the more recent versions of the data -- the memory backing cursors, shared memory areas from ashmem, devices allocating things for you such as graphics textures, etc. There are so many things it can be hard to say what might be going on, which is why the report is more detailed these days. (And even there, we still have a number of things that get collapsed in to unknown.)

有关调试这一点,你可能想看看您的Java堆泄漏的对象。由于实际的分配对象不是在Java堆,这可能是棘手的,当然。我建议及早采取堆转储你的应用程序,这样做不管你做什么,导致其内存占用增加,在这之后采取堆转储,看看什么对象数量有所增加。参考文档显示了如何用MAT比较堆转储。

For debugging this, you probably want to look at your Java heap for leaked objects. Since the actual allocation for the object is not in the Java heap, this can be tricky of course. I'd suggest taking a heap dump early in your app, do whatever you do that causes its RAM footprint to increase, take a heap dump after that, and look for what object counts have increased. The referenced documentation shows how to compare heap dumps with MAT.

此外,当你在看你的Java堆只是作为一般分析的(除非做diff文件时),总是一定要按照说明那里剥离出来堆的受精卵一部分。如文档提到,每一道工序都有大量来自受精卵的分配,但这些跨所以一般不相关的堆分析所有进程共享。我经常看到有人感到担心,因为他们看到了很多非常大的位图在他们的应用程序,该系统似乎已分配在他们身上,认为是在他们的应用程序中使用RAM的重大的事情,当它不,它只是分享拨款从受精卵。

Also when you are looking at your Java heap just as a general analysis (except when doing diffs), always be sure to follow the instructions there for stripping out the zygote part of the heap. As the documentation mentions, every process has a large number of allocations from zygote, but these are shared across all processes so not generally relevant for heap analysis. I very often see people concerned because they see a lot of very large bitmaps in their app that the system seems to have allocated on them, and think that is the major thing using RAM in their app, when it is not, it is just the shared allocations from zygote.

这篇关于对于个人资料的详细解释从&QUOT;亚行外壳dumpsys meminfo中我-APP-名称和QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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