如何使用机器人工作室分析内存如何使用、机器人、内存、工作室

2023-09-12 08:25:06 作者:执笔画浮尘

近日从日食转投Android工作室。如何检查应用程序的堆和内存分配的android工作室?在Eclipse中,我们有MAT是有什么在摄影棚检查堆转储,HPROF文件?

解决方案

我会在一个简单的方法与步骤解释:

首先,你已经安装的 MAT (下载)

在Android的工作室开放的Andr​​oid设备监视器或DDMS。

选择您的进程com.example.etc。

新松多可协作机器人 赋能3C行业新发展

点击更新堆上方的进程列表。

在右侧面板中,选择堆标签。

点击的原因GC。

点击上面的进程列表转储HPROF文件。

当我们下载的文件HPROF,我们要打开终端并运行此命令生成的文件与MAT打开它。

打开终端并运行此命令

  

./ HPROF-CONV路径/ file.hprof exitPath /堆converted.hprof

命令HPROF-CONV是SDK的平台工具文件夹。

,并准备与MAT可以打开并打开转换后的文件(堆converted.hprof)。

Recently switch to android studio from eclipse. How to check app heap and memory allocation in android studio? In Eclipse we have MAT is there anything in the studio to check heap dump, hprof file?

解决方案

I'll explain it in a easy way with steps:

First, you have install MAT ( download )

In Android Studio open Android Device Monitor or DDMS.

Select your process "com.example.etc.."

Click Update Heap above the process list.

In the right-side panel, select the Heap tab.

Click in Cause GC.

Click Dump HPROF file above the process list.

When we downloaded the file HPROF, we have to open the Terminal and run this command to generate the file to open it with MAT.

Open terminal and run this command

./hprof-conv path/file.hprof exitPath/heap-converted.hprof

The command "hprof-conv" is in the platform-tools folder of the sdk.

And ready and MAT can open and open the converted file ( heap-converted.hprof ) .