Puzzling system delays
Every couple of days my 2015 MacBook Pro running Mojave 10.14.4 goes into a state where it simply pauses for 2-3 seconds. I can be typing and nothing comes out, but then in a couple of seconds everything I typed spits out on screen. I can drag a window and nothing happens, and suddenly the window jumps where I moved it.
A reboot fixes the problem temporarily and it comes back in a day or two.
I tried quitting every open program one by one, then every menubar app. Then I turned off Bluetooth. Then I turned off WiFi. Problem persisted.
According to iStat Menus, there's no system load at all and no network traffic (in KB/s).
I reset the SMC and NVRAM for grins and giggles. The problem returned.
Right now it's only pausing maybe every 5 minutes. Sometimes the pauses are every 30 seconds.
Any idea what this could be and how to diagnose?
Old timers may know it as the Apple Hardware Test (AHT)
And yes, running in Safe Mode for several days is also not practical.
Ah cool, @kiwigraham. I've run it before but it was a _very_ long time ago. When I get a break I'll give that a try.
I forgot to mention that I did boot into Safe Mode once to let it clear out any crapola it could, but the problem returned.
Someone suggested I reinstall the OS using the combo updater. Not a step with a direct reason why but just to clear out any OS things that might have gotten boogered (sorry to use such a technical term). It was also suggested that it could be a hardware driver. I do have a few weird ones, like my Epson scanner.
I may have found the culprit. I heard @DaveHamilton say pleasant things about Clean My Mac, so I had installed it via Setapp. The software used to have a bad reputation but since Dave seemed to like it, I thought I'd give it a whirl.
The most recent time my Mac started pausing again, instead of just quitting everything, including Clean My Mac, I decided to uninstall it.
It's been 3 or 4 days and my system hasn't paused since. Not long enough to declare victory but longer than I've gone in the past few weeks without a pause. The timing of the initial installation was right around when this started happening.
That's interesting. I have Clean My Mac X installed on my 2012 MBPr, also via SetApp, and it doesn't seem to interfere with the generally smooth running state of the laptop. I wonder if there are particular options that trigger issues. If memory & CPU don't show as being hogged then I'd guess at the issue being I/O access. So maybe the trash management feature, or background malware scanning?
I'll now keep a more careful eye on whether I get unexpected periods of non-response.......
I figure I might as well use this as my place to document my notes on this, publicly. I am running CMMX on my Office iMac. In the interest of isolation-testing whether or not this is the root cause of my problem, I wanted to disable its background processes but still keep it installed (because Space Lens). I noticed two processes were running in the background: its MenuBar agent, and its "HealthMonitor". The former was disabled with a CMMX preference. All good. The HealthMonitor required me to go into Lingon to disable. All good.
While in Lingon and filtering on "Clean" I saw two other things, both living in /Library/PrivilegedHelperTools — one was "com.macpaw.CleanMyMac-setapp.Agent" — that's fine, the other was "com.macpaw.CleanMyMac3.Agent"... that seems old.
So I took a peek inside /Library/PrivilegedHelperTools. Folks, I highly recommend this. I found many things from apps I no longer use (including a CMM2 agent that existed, but obviously isn't being used/launched). This is the very definition of cruft!
I set about removing a lot of things here using, for example:
sudo rm com.macpaw.CleanMyMac.Agent
...first confirming via Lingon whether or not they were "active" (some were, many were not).
I've reached out to a few developers to get more clarity on exactly what this is, why some/many apps appear to have duplicates here, and how safe my advice to prune is, as well. I'll report back!
I had similar symptoms on a 2018 MBP only when I turned off an external LG display while it was still plugged in. It is a UD2759P display using a USB-C to DP cable from j5 create which is the only way to get full resolution on the LG.
Not a single delay occurrence sine I started unplugging the display when I turned it off.
My cursor would even freeze when the delay kicked in and that is pretty darned low in the bowels so my assumption was that this was a driver-level conflict. Once the delay started it seemed to kick in at regular intervals, about 2 minutes I believe. I did try plugging in to different ports on the MBP but it did not matter.
I hope this helps.
Very interesting @MacMonkeyBoy. I wonder if a full-fledged dock would help alleviate this problem? Nothing against LG or j5 create, but I've got a 27" LG display via the CalDigit TS3+ dock and it does not cause the system delays we've all been chatting about.
It's now been around 2 weeks and I haven't once had a system delay since I fully removed Clean My Mac from my laptop. I'm certain that was the root cause.
@DaveHamilton I have to laugh at all the glop you found in that folder. I know you and I have debated the value of a clean install once a year, but when I look in that folder on my MacBook Pro, I only see apps I'm currently running. It's great for you in terms of discovery of how things work, but it's great for me that I simply don't have years of cruft in my system. Sure makes diagnostics easier.
With the 27" LG display powered off and plugged into the Hyperdrive (non-powered) hub I see the cursor freeze every three seconds. It lasts for less than 1/4 second. As soon as I power up the display the freeze is gone.
This is the hub. It has met all my road warrior needs except I carry an ethernet dongle just in case:
I solved my delay — it was, most certainly, a Keychain problem.
I started by disabling iCloud Keychain (well, first I made a backup, of course), and the problem still existed. That was good news, because it confirmed that my issue was local to only this machine.
Then I mucked about and, in the end, wound up deleting all the “Internet password” and “Web form password” entries in both my “Local Items” and “login” keychains.
That resolved the delays. I re-enabled iCloud Keychain and all is/was well.
Quote: "Any idea what this could be and how to diagnose?"
I recommend a second admin user account be set up on all your Macs — login to this secondary account to analyze whether an issue is "system wide" or "user specific".
A second user account can also be the perfect helper to answer some basic questions that will help decide what steps to take next.
Is the issue reproducible in a new user account?
If yes, issue is system wide
If no, issue is user specific
Is it hardware or software related?
This is easy to split up, disconnect internal hardware such as newly installed RAM etc and detach all external hardware devices while troubleshooting to confirm these devices are not the cause. Removing hardware is consider to help you analyze the cause of an issue.
Ask yourself some probing questions:
When did this issue begin?
Did the issue become apparent after installing an update? (software)
Did the issue occur after installing RAM or any other internal or external hardware? (hardware)
Apple has a very good articles on how to probe for and isolate Mac OS related issues.
As a general rule (and to summarize), minimizing hardware and software configurations and a new user account (for isolation purposes) helps understand where an issue might be sourcing itself from.
Isolating issues in Mac OS X
By using the approach here, you can learn how to isolate an issue to its root cause, or at minimum to determine the sequence of events that causes the issue to occur.
You did perform some good steps, I want to highlight those with some comments:
- Quote "I tried quitting every open program one by one, then every menubar app. Then I turned off Bluetooth. Then I turned off WiFi."
——These steps are efforts in isolating the issue which are important but because the user account itself might be the source it is best to exclude the possibliity of the main user account being the trigger by analyzing whether a new user account reproduces the issue.
- Quote: "A reboot fixes the problem temporarily and it comes back in a day or two."
This is when I recommend a notepad and pen at your workstation. The moment the issue returns, jot down the date and time with a description of what action was performed on the computer. It might help as you analyze an especially intermittent issue. If you believe the console logs can be of some help, especially if you have suspicions, well those dates and times can really help to find messages in the logs to further narrow potentials down to something specific.
- On console logs: The more dates and times you have for events the more samples you can take from the logs to udnerstand any patterns or repeating messages to really begin to correlate a pattern down to something much more specific. So here the rule is, don't let the issue annoy you (if possible) take it as a point of leverage so that you are better equipped (lots of dates and times) when you visit the console looking for hints.
I appreciate the detailed instructions, @Alex-santos. You put a lot of time into that. Unfortunately, the behavior was intermittent enough to make it completely impractical to test so methodically, especially on removing hardware from the mix or working from a second user account. Days would go by with no problems at all, so how could I get valid results?
The bad news is that after more than 3 weeks with no interrupts (thinking removal of Clean My Mac fixed it), I've suddenly got interrupts again. ARGH.
I've spent hours in the past on other problems trying to read console logs and all I get is a headache out of it. I don't know what I'm looking for in the sea of data & the logs are organized in a way that makes no sense to me. I get what you're saying that if I look every time it pauses maybe I'd start to see a pattern, but there's just too much data.
And after I wrote that I got the idea to keep the console running real time in the background where I could see _immediately_ what spit out right when the lags occur. It was really hard to catch but I _may_ have found it. More often than not I saw some sort of message about Bluetooth. I forget whether this ever happens away from my desk, but at my desk, I'm using a Magic keyboard and trackpad.
I was having lags every few minutes, so I plugged the two devices in via USB, and then turned off Bluetooth and I haven't had a lag since. Not declaring victory by ANY means, but I'm trying to use @alex-santos's advice!
Interesting. I've been having unexplained lags on my Office iMac... I'll go to type an email and things pause, just as @podfeet described. Or I'll go to enter a password and Safari will hang. But it's happening in lots of apps, and when it happens the CPU usage of the front-most app spikes.
But since it's happening in lots of apps I've started thinking it's gotta be a system problem. I think I have CMMX installed on that Mac (if I do, it's been that way for far longer than I've had this problem). if so, I'll try removing it. I'm also thinking it's time to run DaisyDisk to see if I've got some mondo log file running again.