* commit '1614f115c38c68d49a74c2553a68a46bd2f4c913': docs: studio 1.3 allocation tracker
This commit is contained in:
BIN
docs/html/images/tools/studio-allocation-tracker-icon.png
Normal file
BIN
docs/html/images/tools/studio-allocation-tracker-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 545 B |
BIN
docs/html/images/tools/studio-allocation-tracker.png
Normal file
BIN
docs/html/images/tools/studio-allocation-tracker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 237 KiB |
@@ -300,7 +300,33 @@ allocations that need to be done for that behavior, what thread they are on, and
|
||||
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 @@ hprof-conv heap-original.hprof heap-converted.hprof
|
||||
</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
|
||||
|
||||
@@ -90,19 +90,24 @@ page.article=true
|
||||
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 @@ page.article=true
|
||||
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>
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ page.article=true
|
||||
<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">
|
||||
|
||||
@@ -226,6 +226,30 @@ snapshot in the <em>Captures</em> view and select <strong>Export to standard .hp
|
||||
|
||||
|
||||
|
||||
<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
|
||||
|
||||
Reference in New Issue
Block a user