4

I'm having trouble getting the native heap information from my HTC Magic running Android 2.2.1. I've configured the standalone DDMS setting "native=true" and used the commands:

  • adb shell setprop libc.debug.malloc 1
  • adb shell stop
  • adb shell start

However, when I try to check if the property is set correctly by issueing the command:

  • adb shell ls

I get the following log message:

  • "/system/bin/sh: Missing module /system/lib/libc_malloc_debug_leak.so required for malloc debug level 1"

Can someone help me with getting the native heap allocations?

Thanks,

Ove Danner

trincot
  • 317,000
  • 35
  • 244
  • 286
Ove Danner
  • 41
  • 1
  • 5
  • Another note: I only see the error by using su in a shell (so 'adb shell' followed by 'su' at the prompt) -- the instructions above do nothing for me -- unless I run the SuperUser app installed when I rooted the phone first. This makes sense to me but none of the malloc debug instructions mention that SuperUser app step so I'm not sure if I'm doing something wrong or not. – Dave Jul 20 '11 at 20:40

1 Answers1

2

I'm using this on a Xoom : http://code.google.com/p/honeycomb-sdk-united-base/source/browse/trunk/system/lib/?r=8

Download the raw file using "save as"and then

adb remount
adb push libc_malloc_debug_leak.so /system/lib/libc_malloc_debug_leak.so

You already have root so the adb remount and pushing to /system/lib should work for you.

You can "probably" also build that library by building Android from source. But this was quicker for me.

Nuthatch
  • 3,597
  • 4
  • 24
  • 17
  • I got a similar recommendation from the mailing list a few days ago and, luckily, it worked! I used the Cyanogen build tho. Of course, you need to have rooted the phone to be able to write to /system/lib (while is initially read-only). – Dave Jul 26 '11 at 01:01
  • A similar method to what Dave described can be found here: http://bricolsoftconsulting.com/2012/04/25/how-to-enable-native-heap-tracking-in-ddms/ – Theo May 11 '12 at 04:53