{
"app": {
"bundleName": "xxx",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"appEnvironments": [
{
"name": "ASAN_OPTIONS",
"value": "log_path=/dev/asanlog/asan.log log_exe_name=true abort_on_error=false detect_leaks=1 alloc_dealloc_mismatch=0 detect_container_overflow=0"
}
],
"asanEnabled": true
}
}
如上所示: 添加detect\_leaks=1后就卡死在启动页,是HarmonyOS套件不支持C++ 检测内存泄露吗?若支持,如何进行配置?
Asan文档中未提供detect\_leaks参数,默认不支持,检测c++内存泄漏的工具可参考HiAppEvent。
Asan文档参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-asan-V5\#zh-cn\_topic\_0000001536844965\_table91481477589
HiAppEvent参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/\_hi\_app\_event-V5