• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: email@hidden
  • Date: Fri, 17 Sep 2010 13:46:06 -0700 (PDT)
  • Importance: Normal

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

  • Follow-Ups:
    • Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
      • From: David Wu <email@hidden>
    • Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
      • From: Craig Newell <email@hidden>
    • Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
      • From: Jonas Maebe <email@hidden>
  • Prev by Date: Why kernel_task consumes so high CPU usage on MacBook AIR?
  • Next by Date: Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
  • Previous by thread: Why kernel_task consumes so high CPU usage on MacBook AIR?
  • Next by thread: Re: Why kernel_task consumes so high CPU usage on MacBook AIR?
  • Index(es):
    • Date
    • Thread