iOS CPU配置文件:为什么此线程会占用99.9%的CPU? [英] iOS CPU Profile: Why might this thread be sucking up 99.9% CPU?
问题描述
有时,当我加载一个表格视图时,除了让该表格视图显示之外,我没有故意执行任何活动,我将等待几秒钟,然后我的CPU使用率急剧上升.我如何找到原因?
Sometimes when I load a table view, and I'm performing no activity intentionally except letting the table view show, I'll wait a few seconds and then my CPU usage shoots up. How can I find the cause?
推荐答案
为什么这个线程会占用99.9%的CPU?
Why might this thread be sucking up 99.9% CPU?
我不知道.但是这里有一些想法:
I don't know. But here are some thoughts:
- 负责的库是
UIKit
.因此,似乎某些用户界面代码已损坏. - 名为
FreeContextStack
的功能已经运行了很长时间. -
pthread_once
和pthread_getspecific
需要花费大量时间.这些功能速度很快,因此必须经常非常运行. - 它们是
GetContextStack
和PopContext
的一部分
- The responsible library is
UIKit
. So it seems that some user interface code is broken. - A function named
FreeContextStack
is running for a long time. pthread_once
andpthread_getspecific
take a considerable amount of time. These functions are fast, so they have to run very often.- They are part of
GetContextStack
andPopContext
似乎在您的代码中有某种上下文"堆栈被推送,但没有弹出.我会寻找UIGraphicsPushContext
或UIGraphicsBeginImageContext
的出现,而没有它们的对口副本.
It seems that in your code there is some sort of "context" stack being pushed—but not popped. I'd look for occurrences of UIGraphicsPushContext
or UIGraphicsBeginImageContext
without their closing counterparts.
但是我可能完全不了解,这些功能不是图形上下文代码的一部分.
But I might be totally off and those functions are not part of graphics context code.
这篇关于iOS CPU配置文件:为什么此线程会占用99.9%的CPU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!