Reputation: 655
I am exploring several options to figure out the best tool/way to find out memory leaks in native code in android app. As part of this exercise, I came across the option present in following url.
I wrote a sample app which calls a native function written in shared library. I put memory leak intentionally in this native function. Before running the app, I did
Then I started the app. But I could not see any prints in the logcat indicating memory leak.
If anybody has ever used this approach to find out the native memory leaks, could you please tell me if I am missing some thing. Is the logcat logs correct place to look for the leak messages? If not, how should I find the leak information?
Upvotes: 1
Views: 4362
Reputation: 11
You are supposed to set backtrace based on the version your application has.
Try this command:
adb shell setprop libc.debug.malloc.options backtrace
Then take dumpheap.
Upvotes: 1