Android Studio Profiler内存分配N / A

Ism*_*bal 7 performance android android-memory android-studio android-profiler

嗨,我在实际设备/仿真器上运行应用程序时无法查看为应用程序分配的内存,分析器显示为“已分配

下面是屏幕截图,

在此处输入图片说明 我正在运行android studio版本3.3.2,是否还需要配置其他内容。

小智 6

I had the same issue and here's what I did to make it work. (This is effective when running on API level < 26 only)

  1. In Android Studio, go to the Configurations menu as shown in the image below and click on Edit Configurations.

编辑配置菜单

  1. Select your app configuration from the menu on the left (usually called "app").
  2. Click on the Profiling tab.
  3. Check "Enable advanced profiling".

配置启用高级分析


Sna*_*ion 5

  1. 启用高级分析。(如果这解决了问题,请忽略其余部分。)编辑配置 > 应用程序 > 分析 > 勾选“启用高级分析”
  2. 在 Android Studio 中,单击分析器按钮打开分析器视图。
  3. 在视图窗格顶部,“会话”右侧,单击下拉菜单并选择“内存”。
  4. 在现在显示“内存”的下拉菜单右侧,您将看到“分配跟踪”和旁边的下拉菜单。单击它(在分析时!)并选择“完整”。

我希望这对你有帮助。

在此处输入图片说明

编辑:我的答案如何更好:它适用于所有 Android 设备!