docs: studio 1.3 allocation tracker
Change-Id: I0cbca0d551c3f066f8fb532d7baf8603dab61112
diff --git a/docs/html/images/tools/studio-allocation-tracker-icon.png b/docs/html/images/tools/studio-allocation-tracker-icon.png
new file mode 100644
index 0000000..3b6e5ba
--- /dev/null
+++ b/docs/html/images/tools/studio-allocation-tracker-icon.png
Binary files differ
diff --git a/docs/html/images/tools/studio-allocation-tracker.png b/docs/html/images/tools/studio-allocation-tracker.png
new file mode 100644
index 0000000..058a099
--- /dev/null
+++ b/docs/html/images/tools/studio-allocation-tracker.png
Binary files differ
diff --git a/docs/html/tools/debugging/debugging-memory.jd b/docs/html/tools/debugging/debugging-memory.jd
index fc9520ab..fc4f4be 100644
--- a/docs/html/tools/debugging/debugging-memory.jd
+++ b/docs/html/tools/debugging/debugging-memory.jd
@@ -300,7 +300,33 @@
from. This is extremely valuable for tightening up these paths to reduce the work they need and
improve the overall smoothness of the UI.</p>
-<p>To use Allocation Tracker:</p>
+<p>To use the Allocation Tracker, open the Memory Monitor in Android Studio and click the
+<a href="{@docRoot}tools/studio/index.html#alloc-tracker" style="vertical-align:bottom;margin:0;height:21px">
+Allocation Tracker</a> icon. You can also track allocations in the Android Device Monitor:</p>
+
+
+<h3>Android Studio </h3>
+<p>To use the <a href="{@docRoot}tools/studio/index.html#alloc-tracker">Allocation Tracker</a> in
+Android Studio: </p>
+
+<ol>
+ <li>Start your app on a connected device or emulator</li>
+ <li>Open the Android run-tme window, and view the free and allocated memory in the Memory
+ Monitor. </li>
+ <li>Click the Allocation Tracker icon
+ (<img src="{@docRoot}images/tools/studio-allocation-tracker-icon.png" style="vertical-align:bottom;margin:0;height:21px"/>) in the Memory Monitor tool bar to start and stop memory
+ allocations.
+ <p>Android Studio creates the allocation file with the filename
+ <code>Allocations-yyyy.mm.dd-hh.mm.ss.alloc</code> in the <em>Captures</em> tab. </p>
+ </li>
+ <li>Double-click the allocation file to open the Allocation viewer. </li>
+ <li>Identify which actions in your app are likely causing too much allocation and determine where
+ in your app you should try to reduce allocations and release resources.
+</ol>
+
+
+
+<h3>Device Monitor</h3>
<ol>
<li>Open the Device Monitor.
<p>From your <code><sdk>/tools/</code> directory, launch the <code>monitor</code> tool.</p>
@@ -641,7 +667,7 @@
</pre>
<p class="note"><strong>Note:</strong> If you're using the version of DDMS that's integrated into
-Eclipse, you do not need to perform the HPROF conversion—DDMS performs the conversion by
+Eclipse, you do not need to perform the HPROF conversation—it performs the conversion by
default.</p>
<p>You can now load the converted file in MAT or another heap analysis tool that understands
diff --git a/docs/html/tools/performance/allocation-tracker/index.jd b/docs/html/tools/performance/allocation-tracker/index.jd
index e71b584..d68f601 100644
--- a/docs/html/tools/performance/allocation-tracker/index.jd
+++ b/docs/html/tools/performance/allocation-tracker/index.jd
@@ -90,19 +90,24 @@
alt=""
width="400px" />
<p class="img-caption">
- <strong>Figure 1. </strong>Steps for starting Allocation Tracker.
+ <strong>Figure 1. </strong>Steps for starting Allocation Tracker in Android DDMS.
</p>
</div>
<li>Connect your mobile device to your computer.</li>
- <li>Open your application in Android Studio, build the source, and run it on your device.</li>
+ <li>Open your application in Android Studio, build the source, and run it on your device or
+ emulator.</li>
<li>Click the <b>Android</b> button at the bottom of your Android Studio window.</li>
- <li>Click the RECORD button
+ <li>If you are using the Android Device Monitor, click the RECORD button
<img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image02.png">
- (Start Allocation Tracking tooltip).</li>
+ (Start Allocation Tracking tooltip) in the Android DDMS tool bar. If you are using Android
+ Studio, click the
+ <img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image02.png">
+ icon in the <a href="{@docRoot}tools/studio/index.html#mem-cpu">Memory Monitor</a> tool
+ bar. </li>
<li>Interact with your application.</li>
@@ -119,7 +124,7 @@
alt=""
width="440px" />
<p class="img-caption">
- <strong>Figure 2. </strong>Example of Allocation Tracker output.
+ <strong>Figure 2. </strong>Example of Allocation Tracker output in Android DDMS.
</p>
</div>
diff --git a/docs/html/tools/performance/comparison.jd b/docs/html/tools/performance/comparison.jd
index 0640717..f79e762 100644
--- a/docs/html/tools/performance/comparison.jd
+++ b/docs/html/tools/performance/comparison.jd
@@ -111,7 +111,7 @@
<h2 id="AllocationTracker">Allocation Tracker</h2>
<div class="figure" style="">
- <img src="{@docRoot}images/tools/performance/compare_AllocationTracker.png"
+ <img src="{@docRoot}images/tools/studio-allocation-tracker.png"
alt=""ge
height="" />
<p class="img-caption">
diff --git a/docs/html/tools/studio/index.jd b/docs/html/tools/studio/index.jd
index bbb4edc..43cb2fe 100644
--- a/docs/html/tools/studio/index.jd
+++ b/docs/html/tools/studio/index.jd
@@ -226,6 +226,30 @@
+<h4 id="alloc-tracker">Allocation tracker </h4>
+<p>Android Studio allows you to track memory allocation as it monitors memory use. Tracking memory
+allocation allows you to monitor where objects are being allocated when you perform certain actions.
+Knowing these allocations enables you to adjust the method
+calls related to those actions to optimize your app's performance and memory use. </p>
+
+<img src="{@docRoot}images/tools/studio-allocation-tracker.png" alt="" />
+ <p class="img-caption"><strong>Figure 6.</strong> Allocation tracker.</p>
+
+<p>Perform the following steps to track and analyze allocations: </p>
+<ol>
+ <li>Click the Start/Stop Allocation Tracking icon
+ (<img src="{@docRoot}images/tools/studio-allocation-tracker-icon.png" style="vertical-align:bottom;margin:0;height:17px"/>) in the
+ <a href="#mem-cpu">Memory Monitor</a>. Android Studio starts tracking memory allocations.</li>
+ <li>Perform the tasks whose mallocs you want to track. </li>
+ <li>Click the Start/Stop Allocation Tracking icon again. Android Studio stops tracking mallocs
+ and saves the data to a file named <code>Allocation-yyyy.mm.dd-hh.mm.ss.alloc</code>. The
+ resulting file appears in the <em>Captures</em> tab. </li>
+ <li>Double-click the file to open it in the allocation viewer.
+ <p>The allocation viewer allows you to view and analyze the allocations your app made while
+ running. </p> </li>
+</ol>
+
+
<h3>Data file access</h3>
<p>The Android SDK tools, such as <a href="{@docRoot}tools/help/systrace.html">Systrace</a>,
<a href="{@docRoot}tools/help/logcat.html">logcat</a>, and