I understand that the kernel_task process is linked to several .kext files found in System/Library/Extensions (and possibly Library/Extensions ?) How can I identify which files are contributing to the 400+ MB memory usage identified in Activity Monitor? Is there anything I can do to uninstall or delete unneeded processes to reduce memory usage here?
macOS Kernel – How to Identify Files and Programs Connected to the kernel_task Process
kernelmacos
Best Answer
I looked for some generic commands that display/manipulate kernel extensions.
kextstat
got my attention and based on its output, the 4th column isThe only problem was that its size was in hexadecimal. So I converted the hexadecimal to decimal and printed only relevant information (like kext bundle id).
Breaking it down:
kextstat -l -k
- print a list of loaded non-built-in kexts| awk '{n = sprintf("%d", $4); print n, $6}'
- pipe the output toawk
, convert the 4th "size" column from hexadecimal to decimal, print that and the kext bundle id.| sort -n
- pipe the output tosort
command and sort the list using numerical comparison (so that "10" is not less than "1 ").You can pipe the output to
tail -n 3
to get top 3 memory hoggers. Here are mine:Update: you can also pipe this to
grep -v com.apple
to see which non-apple kexts are loaded.