This question already has an answer here:
Sometimes when I switch Wi-Fi network or connect to a VPN via Global Protect the memory usage of
/System/Library/CoreServices/WiFiAgent.app shoots up and my fans go mental. Why?
This screenshot is one of the worst times it has happened, the usage is not alway consistent sometimes its 2GB, sometimes 6GB etc etc
Basic macbook pro 13" 2017