this big question may consist of several items
what is memory leak ?
how to monitor Android system memory and performance ？
linux command :
not know exactly :
dumpsys meminfo proc-id
and DDMS (Android SDK tool) !!
Could automatic track memory leak on Android ?
DDMS could help !
but need to do some settings ( group discuss Finding Memory leak in native code )
0. Build libc_debug.so
1. replace system/lib/libc.so with /system/lib/libc_debug.so
2. set environment variables
$PATH with ~/open_src/prebuilt/linux-x86/toolchain/arm-eabi-XXX/bin
$ANDROID_PRODUCT_OUT with ~/open_src/out/target/product/
'PATH' is used for getting "arm-eabi-addr2line" and
ANDROID_PRODUCT_OUT for getting the path to /symbol folder.
3. restart the framework.
adb shell stop && adb shell start
4. Add "native=true" to ~/.android/ddms.cfg
5. start the stand-alone version of DDMS. -> "Native Heap"
but just know that there was an malloc @@ !!
how to avoid memory leak in application ?
from Avoid memory leaks on Android suggestion:
to be continued ...