Just wondering if someone knows how to find out memory leaks in native code from android. Google search gives lot of solution, but none of them is full. Please let me know if anybody knows how to do this.
Asked
Active
Viewed 2.4k times
26
-
I would see if logcat gives this information – Owen O'Brien Feb 23 '11 at 19:15
-
I get low memory no more background processes; PROCESS DIED – NoAIUser Feb 23 '11 at 20:08
1 Answers
31
Really useful information I got to find the leaks in native code.
- add native=true in ~/.android/ddms.cfg
- replace
/system/lib/libc.so
with/system/lib/libc_debug.so
restart the framework, start DDMS, you'll see a tab native-heap
In native-heap, you can see the allocations by native code.
For more information click here

Marek Sebera
- 39,650
- 37
- 158
- 244

NoAIUser
- 3,966
- 6
- 34
- 52
-
6Also see this article for a step-by-step guide on getting the DDMS native heap tracking setup: http://bricolsoftconsulting.com/2012/04/25/how-to-enable-native-heap-tracking-in-ddms/ – Theo May 11 '12 at 04:44
-
6Bricolsoft link changed to http://bricolsoftconsulting.com/how-to-enable-native-heap-tracking-in-ddms/ – Peter Tran Dec 17 '13 at 20:13