简体   繁体   English

如何从android中的本机代码中查找内存泄漏

[英]How to Find memory leaks from native code in android

Just wondering if someone knows how to find out memory leaks in native code from android. 只是想知道是否有人知道如何从Android中找出本机代码中的内存泄漏。 Google search gives lot of solution, but none of them is full. 谷歌搜索提供了很多解决方案,但没有一个是完整的。 Please let me know if anybody knows how to do this. 如果有人知道怎么做,请告诉我。

Really useful information I got to find the leaks in native code. 我找到了本机代码泄漏的真正有用的信息。

  1. add native=true in ~/.android/ddms.cfg 在〜/ .android / ddms.cfg中添加native = true
  2. replace /system/lib/libc.so with /system/lib/libc_debug.so /system/lib/libc.so替换/system/lib/libc_debug.so
    restart the framework, start DDMS, you'll see a tab native-heap 重启框架,启动DDMS,你会看到一个标签本机堆

In native-heap, you can see the allocations by native code. 在本机堆中,您可以通过本机代码查看分配。

For more information click here 有关更多信息, 请单击此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM