summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorRicardo Cervera <rcervera@google.com>2014-07-24 10:15:09 -0700
committerRicardo Cervera <rcervera@google.com>2014-07-25 08:32:15 -0700
commit6c555824ebb9c034d5f99b55470a1dd02419cf07 (patch)
tree10270cf3413b669ba8ba3b62ead69f19e0b2b862 /docs
parent7af4e812d06d7174e9eb677a508c6af0f3ba3608 (diff)
downloadframeworks_base-6c555824ebb9c034d5f99b55470a1dd02419cf07.zip
frameworks_base-6c555824ebb9c034d5f99b55470a1dd02419cf07.tar.gz
frameworks_base-6c555824ebb9c034d5f99b55470a1dd02419cf07.tar.bz2
docs: Describe the alloc tracker in Android Studio
Change-Id: Ic3cfc94950029104ec75ab04a9fac51ba64dd9a9
Diffstat (limited to 'docs')
-rw-r--r--docs/html/images/tools/as-allocstart.pngbin0 -> 590 bytes
-rw-r--r--docs/html/images/tools/as-allocstop.pngbin0 -> 684 bytes
-rw-r--r--docs/html/images/tools/as-alloctrack.pngbin0 -> 49699 bytes
-rw-r--r--docs/html/sdk/installing/studio-debug.jd42
4 files changed, 42 insertions, 0 deletions
diff --git a/docs/html/images/tools/as-allocstart.png b/docs/html/images/tools/as-allocstart.png
new file mode 100644
index 0000000..b9c770a
--- /dev/null
+++ b/docs/html/images/tools/as-allocstart.png
Binary files differ
diff --git a/docs/html/images/tools/as-allocstop.png b/docs/html/images/tools/as-allocstop.png
new file mode 100644
index 0000000..8271161
--- /dev/null
+++ b/docs/html/images/tools/as-allocstop.png
Binary files differ
diff --git a/docs/html/images/tools/as-alloctrack.png b/docs/html/images/tools/as-alloctrack.png
new file mode 100644
index 0000000..4280f02
--- /dev/null
+++ b/docs/html/images/tools/as-alloctrack.png
Binary files differ
diff --git a/docs/html/sdk/installing/studio-debug.jd b/docs/html/sdk/installing/studio-debug.jd
index 7e2efe3..2e3e137 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
<li><a href="#breakPointsDebug">Debug your app with breakpoints</a></li>
</ol>
</li>
+ <li><a href="#allocTracker">Track Object Allocation</a></li>
<li><a href="#deviceMonitor">Analyze Runtime Metrics to Optimize your App</a></li>
<li><a href="#screenCap">Capture Screenshots and Videos</a></li>
</ol>
@@ -281,6 +282,47 @@ step:</p>
<p class="img-caption"><strong>Figure 7.</strong> The Variables view in the Debug tool window.</p>
+<h2 id="allocTracker">Track Object Allocation</h2>
+
+<p>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.</p>
+
+<p>To track memory allocation of objects:</p>
+
+<ol>
+<li>Start your app as described in <a href="#runDebug">Run Your App in Debug Mode</a>.</li>
+<li>Click <strong>Android</strong> <img src="{@docRoot}images/tools/as-android.png" alt=""
+style="vertical-align:bottom;margin:0;height:20px"/> to open the <em>Android DDMS</em>
+tool window.</li>
+<li>On the <em>Android DDMS</em> tool window, select the <strong>Devices | logcat tab</strong>.</li>
+<li>Select your device from the dropdown list.</li>
+<li>Select your app by its package name from the list of running apps.</li>
+<li>Click <strong>Start Allocation Tracking</strong>
+<img src="{@docRoot}images/tools/as-allocstart.png" alt=""
+style="vertical-align:bottom;margin:0;height:20px"/></li>
+<li>Interact with your app on the device.</li>
+<li>Click <strong>Stop Allocation Tracking</strong>
+<img src="{@docRoot}images/tools/as-allocstop.png" alt=""
+style="vertical-align:bottom;margin:0;height:20px"/></li>
+</ol>
+
+<p>Android Studio shows the objects that the system allocated with the following information:</p>
+
+<ul>
+<li>Allocation order</li>
+<li>Allocated class</li>
+<li>Allocation size</li>
+<li>Thread ID</li>
+<li>Allocation method, class, and line number</li>
+<li>Stack trace at the point of allocation</li>
+</ul>
+
+<img src="{@docRoot}images/tools/as-alloctrack.png" alt="" width="750" height="252" />
+<p class="img-caption"><strong>Figure 8.</strong> Object allocation tracking in Android Studio.</p>
+
+
<h2 id="deviceMonitor">Analyze Runtime Metrics to Optimize your App</h2>
<p>Even if your application does not generate runtime errors, this does not mean it is free of