aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-07-27 22:22:52 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-27 22:22:52 -0700
commitccf3d06e43a537d7fbe7bf7f91aaec0814fc1474 (patch)
treeeb33960b6dcf6880c98c3703f62b4695205a8ccb
parentf0e924013eee32054e6f807af101efd70f98f7d3 (diff)
parent89bfe3150c1d0c5f3c4d74152b96130e1fcf29d5 (diff)
downloadsource.android.com-ccf3d06e43a537d7fbe7bf7f91aaec0814fc1474.tar.gz
Merge "Add new development tips and tricks docs."
-rw-r--r--src/source/developing.md42
-rw-r--r--src/source/sidebar.md1
2 files changed, 43 insertions, 0 deletions
diff --git a/src/source/developing.md b/src/source/developing.md
new file mode 100644
index 00000000..042ec6a0
--- /dev/null
+++ b/src/source/developing.md
@@ -0,0 +1,42 @@
+<!--
+ Copyright 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+# Development Tips and Tricks #
+
+A collection of helpful tricks and available facilities for developing
+the platform code. This tips assume that you are working with an eng
+or userdebug build of the platform, not on a production device.
+
+## Debugging Native Memory Use ##
+
+Android's native memory allocator has some useful debugging features. You
+can turn on memory tracking with:
+
+ $ adb shell setprop libc.debug.malloc 1
+ $ adb shell stop
+ $ adb shell start
+
+You need to restart the runtime so that zygote and all processes launched from
+it are restarted with the property set. Now all Dalvik processes have memory
+tracking turned on. You can look at these with DDMS, but first you need to
+turn on its native memory UI:
+
+ - Open ~/.android/ddms.cfg
+ - Add a line "native=true"
+
+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
+especially useful for debugging memory leaks.
diff --git a/src/source/sidebar.md b/src/source/sidebar.md
index 4a9f7971..373db150 100644
--- a/src/source/sidebar.md
+++ b/src/source/sidebar.md
@@ -26,6 +26,7 @@
- [Git Resources](git-resources.html)
- [Using Eclipse](using-eclipse.html)
- [Code Style Guidelines](code-style.html)
+- [Development Tips and Tricks](developing.html)
- [FAQs](/faqs.html)