You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

XProtectRemediatorSheepSwap using ridiculous amount of memory

Over the last couple days, my computer has periodically ground to a halt. The culprit appears to be XProtectRemediatorSheepSwap – which uses anywhere between 30 to 40 GB of memory! (I only have 16GB, so it's clearly using lots of swap). The only thing that helps is rebooting, but even that's only proved temporarily effective so far, as it begins to happen again after some usage.


The other thing I noticed is that it's spamming my console with thousands of these logs:


default 05:24:09.614543-0800 XProtectRemediatorSheepSwap [0x7fb5e20c8de0] activating connection: mach=true listener=false peer=false name=com.apple.bird
default 05:24:09.614682-0800 XProtectRemediatorSheepSwap [0x7fb5e20c8de0] failed to do a bootstrap look-up: xpc_error=[3: No such process]
default 05:24:09.614711-0800 XProtectRemediatorSheepSwap [0x7fb5e20c8de0] invalidated after a failed init
error 05:24:09.614851-0800 XProtectRemediatorSheepSwap Error querying cloud docs root URL: <private>


what's going on? is there anything I can do? I'd really rather not have to lose a day to a clean install.


p.s. I don't seem to be able to change the tags on this, but it got tagged incorrectly – I am indeed on macOS 14.3, not 11.3...


iMac 27″

Posted on Feb 8, 2024 5:30 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 9, 2024 3:36 AM

You have a very very old version of vmware - 8.*, the current version being 13.5, I believe.


Having those obsolete kernel extensions in Sonoma is unlikely to work well.


Also others from 10.9 Mavericks vintage....


As is often the case around here, you have a mac that has been upgraded in place for many years.

At some point, something has got to give.


I strongly recommend that you start fresh. You may be surprised at just how much better your mac performs after following those simple steps:


1) Full backup using Time Machine; if possible, a second backup 2) System Settings->General->Transfer or Reset->Erase All Content and Settings This will leave only the OS itself, and erase all system modifications as well as all accounts, so you did do the backup beforehand, right? 3) When asked, choose to migrate from "another mac, drive or Time Machine backup"; select the TM backup drive used in step 1 4) Select to migrate ONLY the user accounts (no applications, settings or other files - otherwise you'd just be back to where you started) 5) Enjoy a properly working mac. Gradually install the applications that you do need. Never install any "cleaners" or "antivirus".

22 replies
Question marked as Top-ranking reply

Feb 9, 2024 3:36 AM in response to smckie

You have a very very old version of vmware - 8.*, the current version being 13.5, I believe.


Having those obsolete kernel extensions in Sonoma is unlikely to work well.


Also others from 10.9 Mavericks vintage....


As is often the case around here, you have a mac that has been upgraded in place for many years.

At some point, something has got to give.


I strongly recommend that you start fresh. You may be surprised at just how much better your mac performs after following those simple steps:


1) Full backup using Time Machine; if possible, a second backup 2) System Settings->General->Transfer or Reset->Erase All Content and Settings This will leave only the OS itself, and erase all system modifications as well as all accounts, so you did do the backup beforehand, right? 3) When asked, choose to migrate from "another mac, drive or Time Machine backup"; select the TM backup drive used in step 1 4) Select to migrate ONLY the user accounts (no applications, settings or other files - otherwise you'd just be back to where you started) 5) Enjoy a properly working mac. Gradually install the applications that you do need. Never install any "cleaners" or "antivirus".

Feb 8, 2024 3:21 PM in response to smckie

CleanMyMac needs to be removed with any provided installer from MacPaw.


NetShade/KeyShade also should be removed. Not sure if you used an installer to install it, if you did, then remove with the uninstaller. If downloaded from the App Store, then dragging the app to the trash should remove the files that launch on startup.


These types of apps have caused problems and are not recommended:

  • Cleaners
  • Optimizers
  • AntiVirus
  • VPN




Feb 16, 2024 3:20 PM in response to smckie

De-selecting "Install Security Responses and system files" in System Settings->General->Software Updates->Automatic Updates->Info icon will disable /Library/Apple/System/Library/CoreServices/XProtect.app that owns this process, apparently.

https://simplemdm.com/blog/what-is-xprotect/#:~:text=XProtect%20is%20important%20for%20keeping,Open%20System%20Settings%20%3E%20Software%20Update.

Feb 26, 2024 9:25 AM in response to jh2112

I followed dbolli's advice to disable "Install Security Responses and system files" in the Software Update settings, but XProtect continues to run itself even after rebooting. I then booted into Recovery Mode and did "csrutil disable", then rebooted, but XProtect still runs itself. Am I missing something here, or is it actually impossible to turn this service off...?

Feb 26, 2024 1:43 PM in response to jh2112

On my 8GB M1 iMac running macOS 14.3.1, I had no issues for a week or so after disabling "Install Security Responses and system files" but then XProtectRemediatorSheepSwap fired up again and swap memory went from the usual 3GB to 25GB or so. I shut down macOS and re-booted and haven't had the issue since, so the root cause seems to be either a serious memory leak or excessive memory use in XProtectRemediatorSheepSwap so we can only hope there's a fix in the upcoming macOS 14.4 update.

Mar 2, 2024 5:17 AM in response to smckie

I'm on a Late 2015 iMac running MacOS 12.7.2, and I've been having the same issue. XProtectPluginService and/or XProtectRemediatorSheepSwap just grows and grows until I run out of memory. Bear in mind I have 32GB RAM, and about the same amount being used in swap by the time the OOM killer window pops up. iStatMenus shows >32GB memory usage by XProtectPluginService. It's clearly a bug / memory leak from a recent update - I've never had this problem before, and it's now happened twice since my last OS point-release upgrade. I don't run VMWare or any sort of cache cleaners, third party AV, VPNs or anything else that was identified as a potential problem earlier in the thread.

Feb 8, 2024 8:48 PM in response to smckie

I'm still concerned about Tunnelblick, as it is just another open source VPN. The XProtectRemediatorSheepSwap is responsible for scanning and remove Malware and also updates it definition files from web servers. In some cases VPN's will stop this from happening. If you can remove that one as well, then start up in Safe Mode to see if the process is still running wild?

Start up your Mac in safe mode - Apple Support


After that can you post the new EtreCheck report?


Is it possible for you to unplug your external Hard Drives and verify the operation with those removed?

Feb 8, 2024 10:58 PM in response to Mac Jim ID



Mac Jim ID wrote:

I'm still concerned about Tunnelblick, as it is just another open source VPN. The XProtectRemediatorSheepSwap is responsible for scanning and remove Malware and also updates it definition files from web servers. In some cases VPN's will stop this from happening. If you can remove that one as well, then start up in Safe Mode to see if the process is still running wild?
Start up your Mac in safe mode - Apple Support

After that can you post the new EtreCheck report?

Is it possible for you to unplug your external Hard Drives and verify the operation with those removed?


Tunnelblick uninstalled, hard drives unplugged, and running in Safe Mode. With absolutely nothing running except for Activity Monitor, Sheep Swap is still ballooning. Maybe a little slower than before, but it's still troubling. After running the EtreCheck report, it's currently at 22GB (still lower than the 50 which is the highest I've seen so far, but...)


Mar 13, 2024 5:03 AM in response to jh2112

My short-term workaround wound up being creating a script to kill any running XProtect processes, then running that script every minute from the root crontab. After I was confident that XProtectRemediatorSheepSwap was the only real problem, I reenabled the "Install Security Responses and system files" option as well as doing "csrutil enable" from Recovery Mode, I disabled the root crontab entry, and I was going to pare back my script to only kill XProtectRemediatorSheepSwap -- but so far after turning everything back on I haven't run into the problem again. It's possible that there was an update in the interim that fixed the issue.


In case anyone is still suffering from this and wants to try the root crontab option, here's what I did:


  • 1. In your user directory, create kill-xprotect.sh:
#!/bin/sh
ps -ef | grep -i xprotect | grep -v grep | awk '{print $2}' | xargs sudo kill -KILL
  • 2. "chmod a+rx kill-xprotect.sh"
  • 3. "sudo crontab -e", enter your password
  • 4. Add the following entry, replacing "username" with your username, then save and quit:
* * * * * /Users/username/kill-xprotect.sh 


This is for the scenario where you've completely disabled the XProtect suite and it's still running XProtectRemediatorSheepSwap anyway. The adjustment I was going to make was changing the "grep -i xprotect" in the script above to "grep -i xprotectremediator" to only kill those specific processes if they were actively running while letting the other XProtect processes stand, but as I said, the issue hasn't returned since reactivating XProtect and its updates.


I'm sure someone could optimize my script further, but what I have here tided me over until the situation improved.

Feb 8, 2024 5:50 PM in response to Mac Jim ID

CleanMyMac needs to be removed with any provided installer from MacPaw.

NetShade/KeyShade also should be removed. Not sure if you used an installer to install it, if you did, then remove with the uninstaller. If downloaded from the App Store, then dragging the app to the trash should remove the files that launch on startup.

These types of apps have caused problems and are not recommended:
* Cleaners
* Optimizers
* AntiVirus
* VPN


Those are good tips, which I've followed. (fwiw, I'd already removed CleanMyMac but it looks like I missed a couple key files. Should be completely gone now)


But none of that really addresses the key problem here – XProtectRemediatorSheepSwap's ballooning memory usage. Even after fully removing those 2 offenders, and some other cruft that EtreCheck turned up, XProtect is still going haywire & it's still spamming the console with errors.

Feb 9, 2024 8:58 AM in response to Mac Jim ID

I do agree with Luis that there are many legacy files carried over from previous installed that could be causing problems with the scanning of your files by XProtect. Another legacy file located at /Library/Extensions is the intelhaxm kernel extension. This is a old version that has been installed previously and fellow user Barney-15e has noted in another post:

Intel HAXM -- known problem child


This could also explain the kernel panics noted in the EtreCheck report. I understand a clean install is a pain, but it will solve your problem along with installing the updated versions of the software that you are currently using. For example, installing the current version of VMWare will only install the versions of the extensions it needs, while upgrading from a previous version may not remove the extensions that had previously been installed and remain there through OS updates as well.


It is difficult to track down the exact file causing the problem, but there is something stopping the normal operation of XProtect being able to scan your computer for Malware. The SheepSwap process should only run about 5 seconds once per day and for some reason something is forcing it to crash causing it to start/stop constantly. Removing known apps/files is always the first thing that we can do, but sometimes the clean install is the best approach.

Feb 12, 2024 11:49 PM in response to Luis Sequeira1

I'm disappointed that I wasn't able to figure out what specifically was causing XProtect to go haywire, as I'll admit there was a lot of cruft on my computer – but nothing *new* really stood out as the cause of the issue, that started happening all of a sudden.


But I finally broke down and did the clean reinstall, just keeping the user directory, that I'd been dreading for a while. Took me the whole weekend, and I was actually worried that the computer would run out of memory / disk space while I was doing the final Time Machine backup, but it somehow made it through. Back to work today, and everything seems good!

Feb 15, 2024 7:20 AM in response to smckie

Just a short-term solution.. but I find you can simply kill the XProtectRemediatorSheepSwap proces from inside Activity Monitor. Nothing disastrous happens if you do it, memory if freed, and things work again. I assume you can also kill the process with (sudo) kill, from terminal, depending if it is owned by your own user, or root.


I'm on a Catalina system, installed on an old Mac using the setup of dosdude1.com .. one of the patches it includes disables "SIP", which is the Xprotect process, if I'm correct. I' m guessing I may need to change over to the newer OpenCore setup, hoping it is a better way to deal with this XProtect stuff.

XProtectRemediatorSheepSwap using ridiculous amount of memory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.