【问题标题】:How to detect memory leak <Allocated Prior To Attach>?如何检测内存泄漏<Allocated Prior To Attach>?
【发布时间】:2018-10-16 23:39:54
【问题描述】:

我正在尝试通过使用仪器来检测导致内存问题的对象是什么,但是在 Xcode 9.3 中使用仪器时似乎存在问题,如:https://forums.developer.apple.com/thread/97592 中提到的,这也可能是相关的:

Observing property crashes Instruments (Leaks profile) Xcode 9.3 (Swift 4.1)

到目前为止,分配列表如下:

如图所示,所有记录的负责调用者是"&lt;Allocated Prior To Attach&gt;"

这里是调用树:

对于第一条记录(问题)来说,这似乎是一种奇怪的行为。

我的问题是

如果仪器按预期工作,我可以通过知道导致问题的对象是什么来直接弄清楚(对象没有被释放而不是&lt;Allocated Prior To Attach&gt;)。在这一点上,有什么方法可以知道导致问题的对象是什么?

【问题讨论】:

  • 我在同一条路上..修复泄漏但不是运气...
  • 你找到解决办法了吗?
  • @Makaille 还没有:/

标签: swift xcode memory-leaks instruments xcode9.3


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2019-04-04
    • 2012-07-16
    • 2011-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多