2

Activity Monitor

Why is the Wi-Fi process taking so much memory?

EDIT: Apologies, I should have clarified my question. I'm a web developer that spends most of his time developing apps locally. Not interacting with third party apis or database interactions. Possibly it might be my app bundler Webpack serving updated changes constantly to my local server?

Specs

  • MacBook Pro (Retina, 13-inch, Mid 2014)
  • 2.8 GHz Intel Core i5
  • 8 GB 1600 MHz DDR3
  • Mojave 10.14.2
cwd
/
txt
/System/Library/CoreServices/WiFiAgent.app/Contents/MacOS/WiFiAgent
txt
/Library/Preferences/Logging/.plist-cache.ptlzg4rP
txt
/private/var/db/timezone/tz/2018g.1.0/icutz/icutz44l.dat
txt
/System/Library/Caches/com.apple.IntlDataCache.le.kbdx
txt
/usr/share/icu/icudt62l.dat
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/SystemAppearance.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantLightAppearance.car
txt
/System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat
txt
/Library/MessageTracer/SubmitDiagInfo.default.domains.searchtree
txt
/private/var/db/mds/messages/502/se_SecurityMessages
txt
/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/CertLargeStd@2x.png
txt
/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/CertLargeStd.png
txt
/System/Library/Fonts/SFNSText.ttf
txt
/System/Library/Frameworks/AppKit.framework/Versions/C/Resources/Assets.car
txt
/System/Library/PrivateFrameworks/CoreWLANKit.framework/Versions/A/Resources/Assets.car
txt
/usr/lib/libobjc-trampolines.dylib
txt
/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Assets.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/DarkAquaAppearance.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/DarkAppearance.car
txt
/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Assets.car
txt
/private/var/folders/d5/y540nrk96fnckhlwyy_9yxsw0000gp/C/com.apple.wifi.WiFiAgent/com.apple.metal/Intel Iris Graphics/functions.data
txt
/private/var/folders/d5/y540nrk96fnckhlwyy_9yxsw0000gp/C/com.apple.wifi.WiFiAgent/com.apple.metal/3902/libraries.data
txt
/usr/lib/dyld
0
/dev/null
1
/dev/null
2
/dev/null
3
/dev/io8log
4
/dev/io8logtemp
5
*:*
6
/Library/MessageTracer/SubmitDiagInfo.default.domains.searchtree
7
->0x65d3d29751cfa425
8
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib.metallib
9
/System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters.metallib
10
/private/var/folders/d5/y540nrk96fnckhlwyy_9yxsw0000gp/C/com.apple.wifi.WiFiAgent/com.apple.metal/3902/libraries.maps
11
/private/var/folders/d5/y540nrk96fnckhlwyy_9yxsw0000gp/C/com.apple.wifi.WiFiAgent/com.apple.metal/3902/libraries.data
12
/private/var/folders/d5/y540nrk96fnckhlwyy_9yxsw0000gp/C/com.apple.wifi.WiFiAgent/com.apple.metal/Intel Iris Graphics/functions.maps
13
/private/var/folders/d5/y540nrk96fnckhlwyy_9yxsw0000gp/C/com.apple.wifi.WiFiAgent/com.apple.metal/Intel Iris Graphics/functions.data

Since I develop, I would prefer to have more memory for simulators, compilers and running dev infrastructure and tools. How can I diagnose why memory is being allocated for wireless networking?

  • Is there a question? – Allan Jan 21 at 22:52
  • Firstly, welcome to Ask Different! :) I hope you come to find this site has a lot to offer! In case you haven't already, it's worth taking the time to read the tour. Also, can you clarify what you're actually asking us? At present your post is really only a statement. – Monomeeth Jan 21 at 22:53
  • i assume his uestion is why is WIFY using over 2 GB. – jmh Jan 22 at 0:38
  • @jmh That's certainly one guess. Or it could be how to reduce the amount of RAM it's using. Or whether this is normal. Jaysonder, one thing that does stand out to me is the number of ports listed against Wi-Fi. 1,138 makes me wonder what your machine is doing over Wi-Fi, so that may help you get to the bottom of this. Understanding how your Mac is used over Wi-Fi will help inform whether its RAM usage makes sense, and how to reduce it. Either way, it'd be great if you could edit your question to clarify. – Monomeeth Jan 22 at 2:23
  • @Monomeeth Its not my question. i was just commenting. – jmh Jan 22 at 3:17
2

TL;DR - Your Wi-Fi program uses memory when you have network connections. It starts with little allocation and when you run other programs, Wi-Fi uses memory to do that work. Log out to free that memory if you don't want to quit programs or thr don’t release their connections to your liking.


As a developer (or just someone curious about memory allocation / virtual and resident/swap), it's pretty easy to dump the heap and virtual memory map for any process to inspect your current memory allocations.

sudo heap Wi-Fi

Except there's a wrinkle with Wi-Fi so you'll want to pass the process number the actual name of the binary, instead of the whole friendly name. (If you get close - heap knows to prompt you with a list of potential matching processes sudo heap Wi

sudo heap WiFiAgent
sudo mmap WiFiAgent

Now, the larger idea is Apple has re-architected the networking stack. On older OS, kernel just absorbed all the memory needed for networking, but now there are 4 programs (2 pairs) that run in user space and root space and the only reason they use Mach ports and memory is to serve and buffer network connections. If you have less connections open, the usage is small. In practice, I've never seen this cause issues since when you log out and back in (especially if you have no apps start at log in), the allocation of this set of programs is very lean and small.

They only grow when you run programs - so you'd need to look at the programs you run to reduce the load they put on networking. Browsers with lots of tabs open, "apps" that are really electron frameworks and node apps can be chatty on the network side or allocate a lot of resources when a more clean native app might use less system resources.

Wi search in activity monitor

You must log in to answer this question.

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