diff --git a/docs/html/images/tools/as-allocstart.png b/docs/html/images/tools/as-allocstart.png new file mode 100644 index 0000000000000..b9c770a507650 Binary files /dev/null and b/docs/html/images/tools/as-allocstart.png differ diff --git a/docs/html/images/tools/as-allocstop.png b/docs/html/images/tools/as-allocstop.png new file mode 100644 index 0000000000000..8271161221815 Binary files /dev/null and b/docs/html/images/tools/as-allocstop.png differ diff --git a/docs/html/images/tools/as-alloctrack.png b/docs/html/images/tools/as-alloctrack.png new file mode 100644 index 0000000000000..4280f0264490d Binary files /dev/null and b/docs/html/images/tools/as-alloctrack.png differ diff --git a/docs/html/sdk/installing/studio-debug.jd b/docs/html/sdk/installing/studio-debug.jd index 7e2efe3673640..2e3e137be0c62 100644 --- a/docs/html/sdk/installing/studio-debug.jd +++ b/docs/html/sdk/installing/studio-debug.jd @@ -19,6 +19,7 @@ page.title=Debugging with Android Studio
  • Debug your app with breakpoints
  • +
  • Track Object Allocation
  • Analyze Runtime Metrics to Optimize your App
  • Capture Screenshots and Videos
  • @@ -281,6 +282,47 @@ step:

    Figure 7. The Variables view in the Debug tool window.

    +

    Track Object Allocation

    + +

    Android Studio lets you track objects that are being allocated on the Java heap and see which +classes and threads are allocating these objects. This allows you to see the list of objects +allocated during a period of interest. This information is valuable for assessing memory usage +that can affect application performance.

    + +

    To track memory allocation of objects:

    + +
      +
    1. Start your app as described in Run Your App in Debug Mode.
    2. +
    3. Click Android to open the Android DDMS +tool window.
    4. +
    5. On the Android DDMS tool window, select the Devices | logcat tab.
    6. +
    7. Select your device from the dropdown list.
    8. +
    9. Select your app by its package name from the list of running apps.
    10. +
    11. Click Start Allocation Tracking +
    12. +
    13. Interact with your app on the device.
    14. +
    15. Click Stop Allocation Tracking +
    16. +
    + +

    Android Studio shows the objects that the system allocated with the following information:

    + + + + +

    Figure 8. Object allocation tracking in Android Studio.

    + +

    Analyze Runtime Metrics to Optimize your App

    Even if your application does not generate runtime errors, this does not mean it is free of