iOS主线冻结几秒钟

时间:2021-05-06 20:58:05

I am seeing main thread freezing for a few seconds in my app only on iOS 8 (not on previous iOS versions).
I am using @synchronised (self) at a number of places and also using RemoteIO setup. My question is how do I debug where exactly is the main thread blocking and get additional information, such as what it is doing at that time ?

我看到我的应用程序中的主线程仅在iOS 8上停止了几秒钟(不是以前的iOS版本)。我在许多地方使用@synchronised(self)并使用RemoteIO设置。我的问题是如何调试主线程阻塞的确切位置并获取其他信息,例如当时正在做什么?

I am using Xcode 6 so please tell me the best way to debug.

我正在使用Xcode 6所以请告诉我最好的调试方法。

EDIT: Here is the output from Pause.

编辑:这是Pause的输出。

iOS主线冻结几秒钟

iOS主线冻结几秒钟

1 个解决方案

#1


9  

As a first step to understand what's happening I would suggest to simply press Pause in debugger while you're having a freeze. It will show you which thread is doing what at that point.

作为了解正在发生的事情的第一步,我建议您在冻结时只需在调试器中按Pause。它会告诉你哪个线程正在做什么。

You will either see a task that is still executing, or msg_trap row indicating that there's a lock somewhere.

您将看到仍在执行的任务,或者msg_trap行指示某处存在锁定。

Post here what you found out.

在这里发布您发现的内容。

#1


9  

As a first step to understand what's happening I would suggest to simply press Pause in debugger while you're having a freeze. It will show you which thread is doing what at that point.

作为了解正在发生的事情的第一步,我建议您在冻结时只需在调试器中按Pause。它会告诉你哪个线程正在做什么。

You will either see a task that is still executing, or msg_trap row indicating that there's a lock somewhere.

您将看到仍在执行的任务,或者msg_trap行指示某处存在锁定。

Post here what you found out.

在这里发布您发现的内容。