What libc implementation is used in Android platform? What malloc implementation is used (ptmalloc or tcmalloc or anything other)?
libc is Bionic and malloc is Doug Lea version named dlmalloc (with USE_LOCKS enabled for thread-safety).
Update: dlmalloc was removed in january 2016: https://github.com/android/platform_bionic/commit/c650447239352d43acc2fd99a8579a85ae0469ab https://sourceforge.net/p/android-x86/bionic/ci/0ac0cee0d1ab60a92103a5021e76ec31da2e3234/ "Merge "Remove dlmalloc.""
+libc_malloc_src := bionic/jemalloc_wrapper.cpp
+libc_common_c_includes += external/jemalloc/include
So, Android 7 uses external malloc implementation jemalloc (from FreeBSD/Facebook) - http://jemalloc.net/ and https://github.com/jemalloc/jemalloc; android variant of code is there: https://android.googlesource.com/platform/external/jemalloc/
-
1For reference, here's the source code for the dlmalloc used by Android (git master): android.googlesource.com/platform/bionic.git/+/master/libc/… – Ilya Oct 16 '12 at 3:14
-
Other link for source code: code.metager.de/source/xref/android/4.4/bionic/libc/… (5 This code is imported from: g.oswego.edu/pub/misc 6 It is currently version 2.8.6.). Still here at android 6: android.googlesource.com/platform/bionic/+/android-6.0.1_r55/… but not in android 7: android.googlesource.com/platform/bionic/+/android-7.0.0_r27/… – osgx Feb 16 '17 at 13:21

