6.2, Android Studio memory

Android Monitor provides a Memory Monitor, so you can easily monitor application performance and memory usage. You can find useless objects, local memory leaks, and memory usage of connected devices. Memory Monitor shows how your application allocates memory, and displays it in a visual way:
1. Display a graph of available and allocated Java memory
based on time 2. Display garbage processing events based on time
3. Initialize garbage processing events

Memory Monitor workflow

In order to detect and optimize your memory usage, the typical workflow is to run your application, and then perform the following operations:
1. Use the Memory Monitor to detect the application to see if garbage disposal has an impact on performance.
2. If you see a lot of garbage collection events in a short period of time, you can perform relevant analysis.
3. Start allocation tracking to determine whether your code has problems.

Display a running application in Memory Monitor

Go through the following steps to view the application running on a specific device or virtual machine:
1. Open a project
2. Run the application in a physical device or virtual machine
3. Display Android Monitor
4. Click the Monitors tab and display Memory Monitor

Author: Song Zhihui
personal micro-blog: Click to enter

Guess you like

Origin blog.csdn.net/song19891121/article/details/51802828