Usually kernel_task
is out-of-control when some other processes are overusing system calls or resources (memory or disk I/O events).
When this happens, you can use fs_usage
reporting utility which will show you system calls and page faults related to filesystem activity in real-time.
So run this command in Terminal:
sudo fs_usage
then observe which processes are frequently doing some system calls and if you're not using them, consider closing/killing them.
To be more specific, please check the TIME INTERVAL column which gives you elapsed time spent in the system call. A W
appearing after elapsed time indicates the process was scheduled out activity (in that case the elapsed time includes the wait time).
So in order to filter the processes which are using the most time interval in the system calls, run:
sudo fs_usage | grep -v 0.0000
which will show you in the last column the most hungry processes (in terms of kernel time). You may adjust number of zeros for precision (less zeros displayed, more time spent).
For more ideas, also check: How to investigate high kernel task memory usage?
Here are the most common issues:
VBoxHeadless
: if you're using VMs (via vagrant), consider suspending them when not in use;mtmd
: it seems Time Machine backups your data every hour even when your backup drive is not connected (so called local snapshots), so try disabling it (sudo tmutil disablelocal
);wine
: if you're running Windows apps, consider closing them when not in use;Chrome
: limit number of tabs opened at the same time (try OneTab and/or TGS) or kill some Extension processes (JavaScript) via Task Manager, since each tab could generate a separate process.