My Macbook M1 is experiencing severe performance issues at times, but I have hard time finding any hard data that shows what the issue is. htop
shows lots of free memory and cpu, yet it seems as if the machine is thrashing extensively (stuttering, programs freezing for multiple seconds unresponsive, etc) under load. Where can I look to know what the issue is?
I am a developer and use Docker, IntelliJ and Node (webpack create-react-app watch task running, consuming 10-30% cpu constantly) a lot. These usually can consume a lot of resources, but when I look at htop
I see that only about 3GB of 8GB RAM is consumed. That should indicate that I am not running out of memory, right?
Still, it seems as if I am being tricked by these stats: my work desktop computer has 64GB of RAM and an i9 CPU (on paper weaker than the M1), but has no such issues under similar conditions (same project, same programs running, etc.) To me, this indicates that memory is the issue, but I want to see some data supporting this. Where do I look?
The fact that I get multi-second stalls and switching between IntelliJ and Terminal could take a few seconds gives me the impression that we are talking about memory-paging to disk being a factor. htop
does show between 6 and 8 GB being swapped to disk. Modern OS-es do cache a lot of stuff, so this is not that surprising, still, I am wondering why I am not using most of my RAM, if this really is the case?
I mentioned IntelliJ, but this also affects using Chrome and iTerm. Quitting Docker (and the associated processes) seems to lighten the perceived load a bit and the amount of memory swapped out usually goes down by 1 GB or so, which again seems to point to memory.
Hardware: Macbook 2020 with Apple M1, 256GB, 8GB RAM.