Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

100% CPU Usage #25

Open
alexito4 opened this issue Mar 5, 2014 · 2 comments
Open

100% CPU Usage #25

alexito4 opened this issue Mar 5, 2014 · 2 comments

Comments

@alexito4
Copy link

alexito4 commented Mar 5, 2014

Hi!
I recently fund that when I'm developing in the iOS Simulator my mac use one core at 100% and, consequently, the fans work and full speed and the temperature rises a lot.
At first I was thinking that maybe is some bug with a new version of the simulator. But I tried to use instruments to search for some bug in my code and I found that BugshotKit is causing this. Specifically -[BugshotKit updateFromASL] method.

Instruments

I suppose that this method is the one that checks for logs. This happen every time I output a log in my code. But the main problem is that a single line of Log makes this method consume 100% of cpu time for 5 seconds or more.

Is this a normal behavior (because we are trying to read the logs) or is this a real issue?

Thanks! ;)

@marcoarment
Copy link
Owner

Is this under very heavy logging activity? Roughly how many messages are logged at this point in execution? Tens? Hundreds? Thousands? More?

There's no good efficient way to track new ASL messages on iOS�. updateFromASL needs to request all entries from the log API (which I think is limited to the most recent 256) and match them against its internal copy to detect and add new ones.

For responsiveness in picking up new lines, it's triggered by a dispatch_source on stderr. But to avoid dominating the CPU under heavy logging, the consoleRefreshThrottler is meant to rate-limit it. Maybe that's not working right.

@alexito4
Copy link
Author

alexito4 commented Mar 5, 2014

After some time in execution, yes, maybe there are a lot of logs (from core data debugging), but not thousands. But just after starting the app this also happens. It's very strange.
For now I disabled BugshotKit while I'm developing.

Thanks for answering ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants