Aborting or crashing in dlmalloc() usually indicates that the native heap has become corrupted. This is usually caused by native code in an application doing something bad. Sometimes the malloc-debug code will help find problems (like buffer overruns) closer to the point where they occur. On a rooted device: % adb shell stop % adb shell setprop libc.debug.malloc 10 % adb shell start You will start to see some additional messages in the log file. If a problem is encountered the process will abort. You can also try turning on CheckJNI: % adb shell setprop dalvik.vm.checkjni true and perhaps give CheckJNI "forcecopy" mode a try: % adb shell setprop dalvik.vm.jniopts forcecopy These also require stop/start of the app framework. All of these come with a performance penalty. 可将以上属性设置保存到/data/local.prop以防重启消失 libc.debug.malloc=10 dalvik.vm.checkjni=true dalvik.vm.jniopts=forcecopy
android jni memory debug
最新推荐文章于 2022-07-01 21:58:09 发布