使用instruments真机调试内存泄露无法定位的问题

转:

 

Instruments使用简介 https://www.jianshu.com/p/2bfacab55e02

 

问题描述:

instruments已显示有泄露,call tree上面的提示信息时候无法跳转到具体的代码;

解决方案:

打开项目的build setting--搜索到Debug Information Format--单击,更改选项为**** with dSYM File,重新运行instruments即可定位到具体的代码行。

原因:在网上查到,一哥们说是因为非with dSYM File模式下,不会生成dsym文件导致instruments无法跳转,我自己的理解是dsym类似于一个索引文件,instruments可借助该文件跳转到具体代码行。

--------------------- 作者:lixinxindaydayup 来源:CSDN 原文:https://blog.csdn.net/lixinxindaydayup/article/details/80760930?utm_source=copy 版权声明:本文为博主原创文章,转载请附上博文链接!

 

 

 

 

转:instruments无法定位代码

0.1032020.07.22 11:00:59字数 75阅读 380

instruments如果显示有泄露,但call tree上面的提示信息无法跳转到具体的代码;

解决方案:

打开项目的build setting--搜索Debug Information Format,更改选项为DWARF with dSYM File,重新运行instruments即可定位到具体的代码行。

 

 

 

 

 

IOS应用内存泄露问题的检测及定位 https://blog.csdn.net/weixin_44309889/article/details/121159595

xcode8 使用Instruments检测定位并解决iOS内存泄露 https://blog.csdn.net/Mr_zhangrmwork/article/details/76210448

iOS内存泄漏的检测及定位工具-Instruments  https://www.sohu.com/a/278776433_216613

 

xcode如何定位错误  https://www.csdn.net/tags/MtTaEgzsOTc5MzEzLWJsb2cO0O0O.html

报错信息

error:
Undefined symbol: typeinfo for sdk::IConfig
Undefined symbol: vtable for sdk::IConfig

具体信息:
Undefined symbols for architecture x86_64:
  "typeinfo for sdk::IConfig", referenced from:
      typeinfo for sdk::ConfigImpl in sdk.a(config_impl.o)
  "vtable for sdk::IConfig", referenced from:
      sdk::IConfig::IConfig() in sdk.a(sdk_impl.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解决过程

由于IConfig是一个纯虚接口类,一开始没理解提示信息中的函数未定义。
逐个接口检查,后发现中间有个小接口没写后面的=0,加上后问题解决。

 

Xcode5 如何调试 快速定位出错行 https://segmentfault.com/q/1010000000612723

 

如何检测内存泄漏<在附加之前分配>? https://mlog.club/article/522331

我试图通过使用仪器来检测引起内存问题的对象是什么,但是xcode 9.3中似乎存在使用仪器的问题,如:https://forums.developer.apple.com/thread/97592中所述,也可能与此相关:
Observing property crashes Instruments (Leaks profile) Xcode 9.3 (Swift 4.1)
到目前为止,分配列表如下:
enter image description here
如图所示,负责所有记录的呼叫者是"<Allocated Prior To Attach>"
这里是召唤树:
enter image description here
这似乎是第一个记录(问题)的一个奇怪的行为。
我的问题是:
如果仪器按预期工作,我可以通过知道引起问题的对象是什么来直接解决问题(对象不是得到释放而不是<Allocated Prior To Attach>)。在这一点上,是否有任何方法可以知道导致问题的对象是什么?


最佳答案:

关闭“Record reference counts”>“File”中的“Recording options”作为解决方法。

 

What does “Allocated Prior to Attach” mean in Xcode instruments? 

 

其他:

利用Memory Graph定位内存泄露位置 https://www.jianshu.com/p/d6ae0d446d54

 

posted @ 2022-06-06 09:20  LiuZX_贤  阅读(186)  评论(0编辑  收藏  举报