iOS CPU Profile: Why might this thread be sucking up 99.9% CPU?

℡╲_俬逩灬. 提交于 2019-12-05 01:31:02

Why might this thread be sucking up 99.9% CPU?

I don't know. But here are some thoughts:

  1. The responsible library is UIKit. So it seems that some user interface code is broken.
  2. A function named FreeContextStack is running for a long time.
  3. pthread_once and pthread_getspecific take a considerable amount of time. These functions are fast, so they have to run very often.
  4. They are part of GetContextStack and PopContext

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.

Rudi

Its possible you're not ending your UIGraphicsBeginImageContext

I solved the same by adding UIGraphicsEndImageContext after use.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!