aboutsummaryrefslogtreecommitdiff
path: root/en/devices/tech/dalvik/gc-debug.html
diff options
context:
space:
mode:
authorAndroid Partner Docs <noreply@android.com>2017-06-19 21:12:35 -0700
committerClay Murphy <claym@google.com>2017-06-20 13:09:22 -0700
commitd72514453123a8634ae55406807d77f03362a2bd (patch)
treeb528f70cbfa22decfea5899870efc1a42e7b7778 /en/devices/tech/dalvik/gc-debug.html
parent8560a623b8040782583740e9dd1cbc4be310a568 (diff)
downloadsource.android.com-d72514453123a8634ae55406807d77f03362a2bd.tar.gz
Docs: Changes to source.android.com
- 159519221 Add CTS Media 1.3 file link by claym <claym@google.com> - 159296442 Changed devsite tag classes on a couple pages. by cqn <cqn@google.com> - 159296357 Add devsite class to tags in devices/tech/power by cqn <cqn@google.com> - 159296314 Added devsite class to tags in compatibility/cts. by cqn <cqn@google.com> - 159296265 Added devsite class to tags in devices/tech/ota. by cqn <cqn@google.com> - 159273197 Added devsite class to tags for devices/tech/test_infra/t... by cqn <cqn@google.com> - 159269559 Add speed-profile and verify-profile to the list of options by claym <claym@google.com> - 159268556 Add devsite class to tags in devices/tech/display by cqn <cqn@google.com> - 159247742 Add devsite class to tags in devices/tech/admin by cqn <cqn@google.com> - 159246177 Finished adding devsite class to tags on devices/tech/debug by cqn <cqn@google.com> - 159245597 Add devsite tag to classes in devices/tech/debug by cqn <cqn@google.com> - 159128910 Changed breaks to paragraph tags for formatting, and adde... by cqn <cqn@google.com> - 159115811 Add devsite class to tags for devices/tech/config by cqn <cqn@google.com> - 159115392 Added devsite class to tags on devices/tech/connect and d... by cqn <cqn@google.com> - 159114997 Add devsite class to tags in devices/storage and devices/tv by cqn <cqn@google.com> - 158948331 Provide advice to OEM and carrier app developers to reduc... by Android Partner Docs <noreply@android.com> - 158920824 Add devsite class to tags in devices/tech/dalvik by cqn <cqn@google.com> - 158917965 Fix links to sensors.h reference file by claym <claym@google.com> - 158916603 Docs: moving gdb to own page, updating index by hvm <hvm@google.com> - 158915436 Update Security acknowledgement with new researcher info by daroberts <daroberts@google.com> - 158883841 Finish adding devsite class to tags in devices/audio by cqn <cqn@google.com> - 158883680 Add devsite class to tags in devices/sensors and devices/... by cqn <cqn@google.com> - 158871012 Improve Jack deprecation warning message. by gdimino <gdimino@google.com> - 158867373 Add devsite classes to tags for devices/graphics by cqn <cqn@google.com> - 158867298 Added devsite classes to tags in devices/input by cqn <cqn@google.com> - 158867192 Add devsite classes to tags in devices/camera and devices... by cqn <cqn@google.com> PiperOrigin-RevId: 159519221 Change-Id: I924de0c1668bcbcc94ee97e60c144aac4c81708d
Diffstat (limited to 'en/devices/tech/dalvik/gc-debug.html')
-rw-r--r--en/devices/tech/dalvik/gc-debug.html49
1 files changed, 26 insertions, 23 deletions
diff --git a/en/devices/tech/dalvik/gc-debug.html b/en/devices/tech/dalvik/gc-debug.html
index 029fde29..b1a62fe0 100644
--- a/en/devices/tech/dalvik/gc-debug.html
+++ b/en/devices/tech/dalvik/gc-debug.html
@@ -216,8 +216,11 @@ to <code>dalvikvm</code> when starting a command line program. When an app gets
the ANR request signal (SIGQUIT) it dumps information related to its locks,
thread stacks, and GC performance.</p>
-<p>The way to get GC timing dumps is to use:<br>
-<code>$ adb shell kill -S QUIT <pid></code></p>
+<p>The way to get GC timing dumps is to use:</p>
+
+<pre class="devsite-terminal devsite-click-to-copy">
+adb shell kill -S QUIT <var>PID</var>
+</pre>
<p>This creates a <code>traces.txt</code> file in <code>/data/anr/</code>. This
file contains some ANR dumps as well as GC timings. You can locate the
@@ -226,7 +229,7 @@ show a few things that may be of interest. It will show the histogram info for
each GC type’s phases and pauses. The pauses are usually more important to look
at. For example:</p>
-<pre>
+<pre class="devsite-click-to-copy">
sticky concurrent mark sweep paused: Sum: 5.491ms 99% C.I. 1.464ms-2.133ms Avg: 1.830ms Max: 2.133ms
</pre>
@@ -240,14 +243,14 @@ determine if long pauses are caused by the GC being slow or the thread
suspending slowly. Here is an example of what a normal time to suspend
resembles on a Nexus 5:</p>
-<pre>
+<pre class="devsite-click-to-copy">
suspend all histogram: Sum: 1.513ms 99% C.I. 3us-546.560us Avg: 47.281us Max: 601us
</pre>
<p>There are also a few other areas of interest, such as total time spent, GC
throughput, etc. Examples:</p>
-<pre>
+<pre class="devsite-click-to-copy">
Total time spent in GC: 502.251ms
Mean GC size throughput: 92MB/s
Mean GC object throughput: 1.54702e+06 objects/s
@@ -255,15 +258,15 @@ Mean GC object throughput: 1.54702e+06 objects/s
<p>Here is an example of how to dump the GC timings of an already running app:
-<pre>
-$ adb shell kill -s QUIT &lt;pid&gt;
-$ adb pull /data/anr/traces.txt
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">adb shell kill -s QUIT <var>PID</var></code>
+<code class="devsite-terminal">adb pull /data/anr/traces.txt</code>
</pre>
<p>At this point the GC timings are inside of traces.txt. Here is example output
from Google maps:</p>
-<pre>
+<pre class="devsite-click-to-copy">
Start Dumping histograms for 34 iterations for sticky concurrent mark sweep
ScanGrayAllocSpaceObjects: Sum: 196.174ms 99% C.I. 0.011ms-11.615ms Avg: 1.442ms Max: 14.091ms
FreeList: Sum: 140.457ms 99% C.I. 6us-1676.749us Avg: 128.505us Max: 9886us
@@ -342,8 +345,8 @@ reasons. The checks will catch a few errors that could cause heap corruption
such as using invalid/stale local and global references. Here is how to enable
CheckJNI:</p>
-<pre>
-$ adb shell setprop dalvik.vm.checkjni true
+<pre class="devsite-terminal devsite-click-to-copy">
+adb shell setprop dalvik.vm.checkjni true
</pre>
<p>Forcecopy mode is another part of CheckJNI that is very useful for detecting
@@ -355,8 +358,8 @@ the red zone don’t match what is expected, this usually means a buffer overrun
or underrun occurred. This would cause CheckJNI to abort. Here is how to enable
forcecopy mode:</p>
-<pre>
-$ adb shell setprop dalvik.vm.jniopts forcecopy
+<pre class="devsite-terminal devsite-click-to-copy">
+adb shell setprop dalvik.vm.jniopts forcecopy
</pre>
<p>One example of an error that CheckJNI should catch is writing past the end of
@@ -388,18 +391,18 @@ that valgrind is orders of magnitude slower than normal execution.</p>
<p>Here is an example use:</p>
-<pre>
+<pre class="devsite-click-to-copy">
# build and install
-$ mmm external/valgrind
-$ adb remount && adb sync
+<code class="devsite-terminal">mmm external/valgrind</code>
+<code class="devsite-terminal">adb remount && adb sync</code>
# disable selinux
-$ adb shell setenforce 0
-$ adb shell setprop wrap.com.android.calculator2
+<code class="devsite-terminal">adb shell setenforce 0</code>
+<code class="devsite-terminal">adb shell setprop wrap.com.android.calculator2</code>
"TMPDIR=/data/data/com.android.calculator2 logwrapper valgrind"
# push symbols
-$ adb shell mkdir /data/local/symbols
-$ adb push $OUT/symbols /data/local/symbols
-$ adb logcat
+<code class="devsite-terminal">adb shell mkdir /data/local/symbols</code>
+<code class="devsite-terminal">adb push $OUT/symbols /data/local/symbols</code>
+<code class="devsite-terminal">adb logcat</code>
</pre>
@@ -410,7 +413,7 @@ useful information:
<code>art E 5955 5955 art/runtime/gc/collector/mark_sweep.cc:383] Tried to mark 0x2
not contained by any spaces</code></p>
-<pre>
+<pre class="devsite-click-to-copy">
art E 5955 5955 art/runtime/gc/collector/mark_sweep.cc:384] Attempting see if
it's a bad root
art E 5955 5955 art/runtime/gc/collector/mark_sweep.cc:485] Found invalid
@@ -435,7 +438,7 @@ href="https://android-review.googlesource.com/#/c/133932/">https://android-revie
<p>In the case where the object isn’t a root, output similar to the following
prints:</p>
-<pre>
+<pre class="devsite-click-to-copy">
01-15 12:38:00.196 1217 1238 E art : Attempting see if it's a bad root
01-15 12:38:00.196 1217 1238 F art :
art/runtime/gc/collector/mark_sweep.cc:381] Can't mark invalid object