Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
- Subject: Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
- From: David Wu <email@hidden>
- Date: Sat, 18 Sep 2010 10:59:54 +0800
Hi, dgatwood
Thank you very much for providing so useful information.
However, I wonder whether this is the root cause of the problem, because:
1. Our application works very well on other Mac PC or laptops, including Mac Mini/iMac/MacBook/MacBook Pro, the kernel_task consumes very low CPU usage on these machines.. We only meet this problem on MacBook Air.
2. This issue only happenes when the CPU's temperature is high. If we bring MacBook Air to a cool office with Air conditioner, it's much better, and sometimes we don't meet this problem. But if we run our application in a office without air conditioner, this issue happenes after 20-30 minites when the CPU temperature is high enough.
That's why we think this issue is very strange and want to get some help from here.
Thank you very much.
David
On Sat, Sep 18, 2010 at 4:46 AM,
<email@hidden> wrote:
On Fri, September 17, 2010, David Wu wrote:
> I'm a developer working on a multi-media application on Mac OS X. Our
> application is designed to run on all Mac PC/laptop including Mac Mini,
> iMac, MacBook, MacBook Pro, MacBook Air.
> Now we have a problem on testing our application on MacBook Air. When the
> application runs about 20-30 minutes, the idle CPU usage decreases to 0%.
> When I open the Active Monitor, I find the kernel_task consumes very high
> CPU usage, even higher than 100%. This causes the CPU resources for our
> application not enough to handle the multi-media tasks.
The kernel task is not a real task. It represents the kernel, which is
the core of the operating system. The bulk of what it does occurs at the
direct request of an application. Every time you allocate a large block
of memory, open or close a file, read or write a file, pull data over the
network, create a new process or thread, etc., your application performs a
system call. These calls cause the kernel to do work for your
application. Much of that work is billed to the kernel task, but it
really is being done by your application, albeit indirectly.
My advice would be to take advantage of the performance profiling tools in
Instruments to find out which system calls your application is spending a
lot of time doing, then find ways to reduce the number of times you call
them. For example, read data from disk in larger chunks. Reuse large
memory allocations instead of releasing them and re-allocating them. And
so on.
Start by reading these two docs:
http://developer.apple.com/library/mac/#documentation/Performance/Conceptual/PerformanceOverview/Introduction/Introduction.html
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40004652
and go from there.
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden