Closed PSalant726 closed 5 months ago
It's worth noting that the command delay issue only appears after running my terminal for some time, gets worse with each additional command that is executed, and is temporarily fixed by a system restart. This implies to me that there's a memory leak somewhere, but I have checked in Activity Monitor while experiencing the problem and I am not apparently CPU- or memory-bound. No other apps or system services appear to be affected.
The logs you've posted show that the initialization of gitstatus is taking an extreme amount of time. What normally takes milliseconds, does not complete within the allotted 10 seconds.
You could increase the 10s timeout but it would not resolve the underlying issue: your machine would still be unusably slow. If you find a way to fix the culprit of degraded performance, the gitstatus issue will resolve itself.
To verify the hypothesis that your machine is generally very slow when this issue happens, you can run the following command in zsh:
=true && time ( repeat 1000 =true )
Note the total
number at the end of the output. If my theory is correct, this number will be much higher when your machine starts experiencing issues compared to the number you'll get shortly after reboot.
While experiencing the issue:
$ =true && time ( repeat 1000 =true )
( repeat 1000; do; =true; done; ) 0.18s user 0.61s system 78% cpu 0.991 total
Immediately after a reboot:
$ =true && time ( repeat 1000 =true )
( repeat 1000; do; =true; done; ) 0.19s user 0.69s system 78% cpu 1.130 total
I'm really not seeing much difference here. I'll reiterate that I have never appeared to be CPU- or memory-bound, and the issue appears to be limited to command execution in the terminal (no other apps or system services are noticeably slower). Are there any tools you can recommend that might help me identify the problem?
Maybe you run out of file descriptors. Google "macos increase file descriptor limit" and try it. There is also a command to query the current limit and the number of open file descriptors. You can use these to check whether this is indeed the problem.
I discovered a rogue process enforced by my employer which has been leaking memory and causing CPU usage spikes. Killing the process resolves the slowness in my terminal. Thanks for your help!
After running powerlevel10k through iTerm for "a while", commands begin to take a very long time to run. When this happens, opening a new terminal gives:
With
GITSTATUS_LOG_LEVEL=DEBUG
set, opening a new terminal gives:I am unsure how to determine any steps towards remediation from the above. Please advise.