I have had a week-long compression process run on an MacBook. When it hit 95%, the speed suddenly dropped to just 5% CPU usage. Tracing the problem, I found that kernel_task
is taking up 6.87GB, leaving roughly 1GB to the other processes. This leads to thrashing on the compression process. Tracing the issue further, I found that a bash
process is using nearly 1TB (!) of kernel memory. This is slightly more than the free space on my hard drive! No clue what it's doing, no other process seems to have this as its parent.
I closed all bash windows, but the process stayed. Ran kill
on it, no difference. I finally killed it using kill -9
.
In Why does leaked memory appear malloced to kernel_task, and why can't OS X therefore garbage collect it, killing Preview resolved this issue, but in my case, the memory usage of kernel_task
remained. Maybe due to how it was killed. Tried running sync
and purge
, no difference. Garbage collect does not apply to kernel_task
. Any other things I could do to reclaim this memory? Theoretically, if I could get the inactive memory at least moved to swap, then the compression process would have enough to quickly complete what it's doing.
No kernel extensions seem to be using an abnormal amount of memory, no third-party extensions are installed.
sudo
. One process compressing a lot of files. The linked answer says no garbage collection; but the "no swapping" is news to me. So I will have to restart the computer, and re-start the compression all over again?sudo
, but I'm not sure which one, since I tried to find many. The heating mitigation would increase CPU, not memory, so that's not the case here.