【发布时间】:2014-01-02 21:30:14
【问题描述】:
我已经使用分析器来查找内存泄漏并遇到了这个问题:
我切换到调用 Tree。
所以我可以点击它来了解更多信息:
但这并没有给我任何线索。我应该如何知道导致泄漏的原因?
更新:
- 上面显示的带有系统库的调用树已更新。
- 泄露的对象信息:
- 关于您在应用中为重现此泄漏所做的操作的一些描述:
我们的应用在启动(前台)时与我们的 REST-API 同步。这始终适用于我的 iOS 7/iPhone 4S。但是另一位开发者拥有 iOS7/iPhone 5,并且很少遇到不同步的问题。经过 10 天的观察并把NSLogs 到处放,我们昨晚发现了这个:
Dec 15 03:18:58 appname[4801] <Warning>: A gateway to the host server is working via WWAN.
Dec 15 03:18:58 appname[4801] <Warning>: Syncing...
Dec 15 03:18:58 appname[4801] <Warning>: Eventname to be fired: f11-reachability
Dec 15 03:18:58 appname[4801] <Warning>: Sync event IOS_REACHABILITY reached.
Dec 15 03:18:58 appname[4801] <Warning>: Sync: IOS_SYNC_WITH_SERVER is true
Dec 15 03:18:58 appname[4801] <Warning>: Animating indicator...
Dec 15 03:18:58 appname[4801] <Warning>: Getting last timestamp: 1387003344.407783 then calling syncWithServerWithDate
Dec 15 03:19:27 com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilecal[0x45fb]) Exited: Killed: 9
Dec 15 03:19:27 com.apple.launchd[1] <Notice>: (com.apple.afcd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Dec 15 03:19:27 com.apple.launchd[1] <Error>: (com.apple.afcd) assertion failed: 11B554a: launchd + 35697 [3C91C465-EFA6-32C7-A677-DD0B5FDEE0DC]: 0x9
Dec 15 03:19:27 com.apple.launchd[1] <Notice>: (com.apple.absd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
第三次尝试同步(按下主页按钮并返回前台)给了我们这个,这表明内存不足:
Dec 15 03:25:18 C1 appname[4801] <Warning>: Getting last timestamp: 1387003344.407783 then calling syncWithServerWithDate
Dec 15 03:25:29 C1 profiled[6244] <Notice>: (Note ) profiled: Service stopping.
Dec 15 03:25:40 C1 crash_mover[6248] <Notice>: (Warn ) <crash_mover.m mv_recursive:98> Moving './LowMemory-2013-12-14-160222.plist' -> '/var/mobile/Library/Logs/CrashReporter/LowMemory-2013-12-14-160222.plist'
所以我想我试试探查器,看看有没有发现什么。
为了重现它,我启动了应用程序,转到主屏幕,然后按Simulate a Low Memory,然后单击应用程序回到前台。这就是我得到红色尖峰的地方。
- 您正在运行的 Xcode 版本。
Xcode 5.02。 iOS 7.04 在 iPhone 4S (OK), iPhone 5 (rare edge case)
我希望这会有所帮助。谢谢
【问题讨论】:
-
“调用树”标题下左侧的所有这些小框。我通常发现单击所有这些小框会产生更易读的结果。
-
当您手动模拟内存警告时,您是否表现出您的同事遇到的同步失败?
标签: ios xcode memory-leaks ios7