Skip to content

Most visited

Recently visited


Measure App Performance with Android Profiler

The new Android Profiler window in Android Studio 3.0 and higher replaces the Android Monitor tools. These new profiling tools provide realtime data for your app's CPU, memory, and network activity. You can perform sample-based method tracing to time your code execution, capture heap dumps, view memory allocations, and inspect the details of network-transmitted files. Check out the following video for an introduction to the Android Profiler.

To open the Android Profiler window, follow these steps:

  1. Click View > Tool Windows > Android Profiler (you can also click Android Profiler in the toolbar).
  2. At the top of the Android Profiler window, as shown in figure 1, select the device 1 and the app process 2 you want to profile. If you've connected a device over USB but don't see it listed, ensure that you have enabled USB debugging.

    If you're using the Android Emulator or a rooted device, the Android Profiler lists all running processes, even though they might not be debuggable. When you launch a debuggable app, that process is selected by default.

Android Profiler now displays a shared timeline view (figure 1), which includes a timeline with realtime graphs for CPU, memory, and network usage. The window also includes timeline zoom controls 3, a button to jump forward to the realtime updates 4, and an event timeline that shows activity states, user input events, and screen rotation events 5.

Once you start Android Profiler, it continues to collect profiling data until you either disconnect the device or click End Session.

Figure 1. The Android Profiler shared timeline view

This shared timeline view only shows the timeline graphs. To access the detailed profiling tools, click the graph that corresponds to the performance data you want to inspect. For example, to access tools to inspect the heap and track memory allocations, click the MEMORY graph. For more documentation about each of the profiling tools, see the following:

However, not all profiling data is visible by default. If you see a message that says, "Advanced profiling is unavailable for the selected process," you need to enable advanced profiling in your run configuration.

Enable advanced profiling

To show you advanced profiling data when running a device with Android 7.1 or lower, Android Studio must inject monitoring logic into your compiled app. Features provided by advanced profiling include:

To enable the advanced profiling, follow these steps:

  1. Select Run > Edit Configurations.
  2. Select your app module in the left pane.
  3. Click the Profiling tab, and then check Enable advanced profiling.

Now build and run your app again to access the complete set of profiling features. However, be aware that the advanced profiling configuration slows your build speed, so you should enable it only when you want to start profiling your app.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)