MacOS – Why would the Mac be slow after inactivity and then get to full speed after 20-30 minutes of use

macosmemoryperformance

My Macbook appears to get slow after a period of inactivity and then get itself back to full speed after 20-30 minutes.

While I have some ideas I'm wondering if anybody else has seen such behaviour or can offer some tips on how to investigate it further.

I have 16GB of RAM and I tend to run a reasonable workload. I have VMWare Fusion with a Windows and an Ubuntu guest running as well as Eclipse and Chrome (and probably Mail and iTunes).

Once I'm done for a while I'll either shut the lid or just leave the machine on and open. What I notice is that when I come back to it it can be dreadfully slow. Eclipse or the Windows guest can sit there for a 10-30 minutes with a spinning icon or not doing much.

After 20-30 minutes everything seems to come to full speed.

My guess is that MacOS is paging out everything in memory and then being forced to page it back in. However, I don't know enough about MacOS to provide evidence for this – nor to look for another explanation.

Best Answer

The clearest way I can see to see whether data is being paged in or out of RAM is the command line program top. Open a Terminal and run top.

Within the first few lines of output look for "swapins" and "swapouts". The values at the end tell you how many pages have been swapped in and out of memory. The values in the brackets are the delta for that update (top updates once a second by default).

If your Macbook is swapping Eclipse or your VMs back into RAM when you wake it or come back to it after leaving it for a while, then the swains number should be changing significantly each second.

Terminal running top