diff options
author | Clay Murphy <claym@google.com> | 2016-06-29 17:44:11 -0700 |
---|---|---|
committer | Clay Murphy <claym@google.com> | 2016-07-06 10:57:07 -0700 |
commit | 3ba110388851b954339776e1e2f433db958b5a10 (patch) | |
tree | d331b5cc008a3ce6c91ff5dd3524350a96a6f7cc | |
parent | ff49a32e3e3335167578ffd57f155614608c444c (diff) | |
download | source.android.com-3ba110388851b954339776e1e2f433db958b5a10.tar.gz |
Docs: Remove outdated adb shell commands, add reference to libmemunreachable
Bug: 21581765
Change-Id: I43429d174d36e5b8438a57c615301f02eae02819
-rw-r--r-- | src/devices/tech/debug/native-memory.jd | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/devices/tech/debug/native-memory.jd b/src/devices/tech/debug/native-memory.jd index 98436772..7546e28a 100644 --- a/src/devices/tech/debug/native-memory.jd +++ b/src/devices/tech/debug/native-memory.jd @@ -16,29 +16,28 @@ page.title=Debugging Native Memory Use See the License for the specific language governing permissions and limitations under the License. --> +<h2 id="malloc_debug">Malloc debug</h2> + <p>See <a href="https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README.md">Malloc Debug</a> and <a href="https://android.googlesource.com/platform/bionic/+/master/libc/malloc_debug/README_api.md">Native -Memory Tracking using libc Callbacks</a> for a more thorough description of the +Memory Tracking using libc Callbacks</a> for a thorough description of the debugging options available for native memory issues.</p> -<p>This tip assumes that you are working with an eng -or userdebug build of the platform, not on a production device.</p> -<p>Android's native memory allocator has some useful debugging features. You -can turn on memory tracking with:</p> -<pre><code> $ adb shell setprop libc.debug.malloc 1 - $ adb shell stop - $ adb shell start -</code></pre> -<p>You need to restart the runtime so that zygote and all processes launched from -it are restarted with the property set. Now all app processes have memory -tracking turned on. You can look at these with DDMS, but first you need to -turn on its native memory UI:</p> -<ul> -<li>Open ~/.android/ddms.cfg</li> -<li>Add a line "native=true"</li> -</ul> +<h2 id="ddms">Dalvik Debug Monitor Server</h2> + +<p>You can also use the <a +href="https://developer.android.com/studio/profile/ddms.html">Dalvik Debug +Monitor Server</a> (DDMS) to obtain a graphical view of Malloc Debug +output.</p> + +<p>To use DDMS, first turn on its native memory UI:</p> +<ol> +<li>Open <code>~/.android/ddms.cfg</code></li> +<li>Add the line: <code>native=true</code></li> +</ol> + <p>Upon relaunching DDMS and selecting a process, you can switch to the new -native allocation tab and populate it with a list of allocations. This is +native allocation tab and populate it with a list of allocations. This is especially useful for debugging memory leaks.</p> |