So, I have an older MacBook Air, a late 2010 to be precise. Currently, it’s my full time workstation. I love that I can just toss it in my bag and have close to all day computing with me. But, this little guy has 4 precious gigabytes of RAM that are constantly under attack. I received a pro tip from Rebeeca Shen (linkedin) the other day about about clearing file / app cache and I’d like to share this one liner with you:
And vula! You’re system’s memory should look more healthy, and you should notice an up tick in performance. The man page is pretty slim on what’s happening under the hood, but I suspect (warning full speculation here) that OS X makes a RAM disk that it then saves files you’ve worked on recently, and browser cache, etc and attempts to make the machine quicker by having these resources in RAM. Well, it ain’t helping with 4GB of RAM. I’ve saved this as a cronjob to run every 30mins and so far I haven’t had any swap usage. Obvious side effects may include slower application start times, and file retrieval, so you may want to tune the cronjob to your liking.
EDIT: Rebecca dropped some more knowledge on me, if you’re dealing with WindowServer and/or kernel_task sucking the life out of your CPU and/or RAM try these steps.