Xcode泄漏工具卡在MapkKit / CllocationManager Ios8上

时间:2014-10-21 16:21:22

标签: ios xcode memory-leaks

我在使用Xcode工具尝试在我的应用程序中查找泄漏时遇到了奇怪的问题。 除了带有mapView的屏幕之外,我的所有屏幕都正常工作(例如,我有一些注册屏幕,然后用户进入MapView屏幕,以防用户登录Mapview屏幕打开)。我认为这个问题在某种程度上与CllocationmManager有关 但我不确定,因为应用程序只是在使用泄漏工具时卡住了。 我从我的设备收到以下日志:

timed[53] <Notice>: (Note ) CoreTime: Received time 10/21/2014 15:54:04±0.00 from "GPS" 
timed[53] <Notice>: (Note ) CoreTime: Want active time in 3332.92min. Need active time in 
8332.92min. Remaining retry interval: 0.000000min.
<Notice>: (Note ) CoreTime: Received time 10/21/2014 15:54:09±0.00 from "GPS"
<Notice>: (Note ) CoreTime: Want active time in 3332.82min. Need active time in 8332.82min.        
CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 0
CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 1
CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 2
<Error>: throttleCallBack(): Clearing throttle timer on context ID 3
timed[53] <Notice>: (Note ) CoreTime: Received time 10/21/2014 15:54:14±0.00 from "GPS"
 timed[53] <Notice>: (Note ) CoreTime: Want active time in 3332.75min. Need active time in     
 CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 0
 CommCenter[69] <Error>: throttleCallBack(): Clearing throttle timer on context ID 1

CoreLocation: Discarding message for event 0 because of too many unprocessed messages

根据该链接,我认为最后一行是最重要的:iOS5 What does “Discarding message for event 0 because of too many unprocessed messages” mean?
是的,我的locationManager在主线程上运行(它在调试模式下工作得很好,没有它)。

我也尝试使用模拟器(它也卡住我认为有一些不同的原因,但我需要主要在设备上进行测试,因为我的应用程序严重依赖于用户位置)。
我在我的方案中设置了所有可能的配置进行调试 我试图重启设备 我试过iphone 5s和4。 (我使用Xcode6 Ios8)。

有没有人有类似的问题或想法我能尝试什么? 非常感谢。

1 个答案:

答案 0 :(得分:1)

最后我发现了问题。那问题很愚蠢我相信没有多少人会遇到这种问题,但我会发布我的愚蠢错误。 当我开发应用程序时,我在那里包含了很多日志(来自服务器的一些响应),因为时间过去我忘记删除它们(当然在发布之前我会)。 当应用程序在使用工具运行时实际上卡住了应用程序。 我从苹果支持收到的回复:

  

由于NSLog也在主线程上写入,它阻止了地图显示和位置管理器。   要记住的一件事是,虽然NSLog通常用于打印我们的调试信息,但这不是真正的工作。   如果查看Foundation Framework Reference文档,NSLog将被描述为:将错误消息记录到Apple System Log工具。   因此,它是一个非常重量级的调用,并且会大大影响应用程序的性能。

当我运行“时间分析器”时,我注意到在某些方法中运行Nslog的百分比时间非常高.......