如何从android中的本机代码中查找内存泄漏 [英] How to Find memory leaks from native code in android

查看:17
本文介绍了如何从android中的本机代码中查找内存泄漏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道是否有人知道如何从android中找出本机代码中的内存泄漏.谷歌搜索提供了很多解决方案,但没有一个是完整的.如果有人知道如何做到这一点,请告诉我.

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.

推荐答案

非常有用的信息,我找到了本机代码中的漏洞.

Really useful information I got to find the leaks in native code.

  1. 在 ~/.android/ddms.cfg 中添加 native=true
  2. /system/lib/libc.so 替换为 /system/lib/libc_debug.so
    重启框架,启动DDMS,你会看到一个标签native-heap

在native-heap中,你可以看到native code的分配情况.

In native-heap, you can see the allocations by native code.

有关详情点击此处

这篇关于如何从android中的本机代码中查找内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆