5

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?

migrated from stackoverflow.com Feb 20 '15 at 13:44

This question came from our site for professional and enthusiast programmers.

  • 1
    The kernel_task is one process - what do you mean by "processes are contributing" – Mark Feb 20 '15 at 13:49
  • 1
    Are you talking about the kernel_task process using 400MB physical memory? It's using 2.6GB here, so 400MB doesn't sound too bad. – nohillside Feb 20 '15 at 13:51
  • I guess I really mean what .kext files are related to it. I understand that they are configuration files for various programs on Mac OS but some may be unnecessary. How can I know which? Can I uninstall those that are no longer needed? – intcreator Feb 23 '15 at 5:35
6

I looked for some generic commands that display/manipulate kernel extensions. kextstat got my attention and based on its output, the 4th column is

The number of bytes of kernel memory that the kext occupies. If this is zero, the kext is a built-in part of the kernel that has a record as a kext for resolving dependencies among kexts.

The 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).

kextstat -l -k | awk '{n = sprintf("%d", $4); print n, $6}' | sort -n

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 to awk, convert the 4th "size" column from hexadecimal to decimal, print that and the kext bundle id.
  • | sort -n - pipe the output to sort 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:

1757184 com.apple.nvidia.driver.NVDAGK100Hal
2572288 com.apple.nvidia.driver.NVDAResman
3923968 com.apple.driver.AirPort.Brcm4360

Update: you can also pipe this to grep -v com.apple to see which non-apple kexts are loaded.

  • Looks pretty much okay then I guess...AirPort refers to wifi in general, right? It should be in use even if I don't have an AirPort router, right? – intcreator Jul 18 '15 at 0:01
  • 1
    Yes, this one refers to WiFi in general. – Eimantas Jul 18 '15 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .