Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My MacBook Pro has 8G RAM. Recently memory leak offen happened. Page outs and swap used kept increasing. The last time it used ~8G swap space.

But in Activity Monitor, I can't find any process has a large value in 'Real Mem', 'Private Mem' nor 'Shared Mem' column.

I checked the %MEM column in output of 'ps -ev', all processes occupied less than 1% of memory. The full output is put in this gist:

What the way to diagnose OSX memory leak issue?

share|improve this question
The %mem statistic seems to be ... weird. I can't figure out what it's a percentage of. Try ps -axv instead, and take a look at the RSS (resident memory in KB) and VSZ (virtual memory, also KB) columns. – Gordon Davisson Feb 12 '13 at 7:13
Memory leak might be caused by Since I removed this app, free memory > 3G for a few days. But this question is still valid, because seeing the output from both Activity Monitor and ps -axv, used not too much memory. – aleung Feb 18 '13 at 9:19
I am in a similar situation, and would also like to know the answer. Perhaps we should look in the console and system logs. – user55316 Aug 18 '13 at 14:09

Check with this command (will show more processes):

sudo ps -awxm -o %mem,rss,comm | sort -nr | head

if won't help, check with fs_usage to display system calls and page faults related to filesystem:

sudo fs_usage -f filesys,diskio

especially page in and out by appending the following to above command:

| egrep -i "page_|pgin|pgout"

Add extra | grep -v kernel to ignore kernel process or | grep -v 0.00 to show these with higher time spent.

If your swap is big, you can force disk cache to be flushed and emptied by: sudo purge.

Based on my experience, OS X have some issues with managing the memory after higher uptime (when it used all of free memory), so sometimes only full restart may help.

Check also sudo iotop or sudo vm_stat 1 commands which may help.

See also: How to investigate high kernel task memory usage?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.