8

Why is it that my Mac (running 10.8 Mountain Lion) would rather swap than clear inactive memory? I know people say that the Mac OS manages itself and whatever, but there is a serious performance dip when my MacBook starts swapping out, even though it would have over 1.5 GB of inactive memory that isn't being cleared out. I have a launcher for the purge command in my dock - thats how severe it is!

Section of Activity Monitor showing memory statistics

Note the 2.21 GB of inactive and the 127.1 MB of swap, which, through the use of all the programs in my workflow, (Photoshop + Illustrator + Dreamweaver + Publisher etc.) will grow rapidly unless I use the purge command, saving my computer from a slaughter fest of beach balls.

6
  • What does vm_stat 15 show over a two minute period when "swapping" is happening? What processes are getting CPU time at that moment?
    – bmike
    May 24, 2012 at 11:46
  • What app is PB?
    – Cajunluke
    Jun 15, 2012 at 22:35
  • You might never get a satisfying answer to this: virtual memory systems can be complex, and can demonstrate emergent behavior which is hard to explain simply. That said, some people have said 10.7 has issues with memory management in some cases -- did 10.6 behave better for you?
    – Ken
    Jun 15, 2012 at 23:48
  • Also, Photoshop has a number of custom memory settings available. How do you have that configured?
    – Ken
    Jun 15, 2012 at 23:51
  • 10.6 didn't do this, and i hope the 10.8 dp4 won'y either. @CajunLuke PB is publisher, i changed my answer
    – Alexander
    Jun 16, 2012 at 0:32

1 Answer 1

11

I recently answered a question like yours, so thought I'd restate the major points for you, in case this is still a problem.

Mac OS X allocates and uses RAM differently than most versions of MS Windows and can be confusing at times. Microsoft originally built Windows to keep as much memory free as possible. Apple's memory model follows a guideline that empty RAM is a wasted resource that could be better utilized to enhance performance.

Here is a quick and somewhat simplistic breakdown of how your RAM is currently being used:

  • Wired: memory reserved and used by the operating system
  • Active: memory used by currently running programs
  • Inactive: memory used by programs you previously ran since your last reboot, but have since quit. Most people use a few programs repetitively all the time and may switch between them by quitting one program and then launching another. Rather than releasing the memory to be "free", the inactive programs are cached and ready to run again. Some or all of this memory will be combined with Free memory as needed by the system or programs. OS X at times seems reluctant to release inactive memory.
  • Free: memory as of yet unused since the last boot.
  • Used: total of wired, active and inactive.

The VM statistics are reset every time you reboot.

If your MacBook is capable of being upgraded beyond 4GB RAM, I'd definitely invest in a pair of 4GB SO-DIMMs for a total of 8GB installed. One other point to keep in mind concerning your MacBook is that typical notebook hard drives are slower than many of their desktop counterparts. I replaced my first generation unibody MacBook Pro's hard drive with a 256GB SSD. Performance incomparable with any "modern" MacBook Pro. The increase from hard drive to SSD was quite a bit more noticeable than my upgrade from 4GB to 8GB of RAM.

5
  • One of my SODIMMs causes kernel panics, so the best I can get is a single 4GB module =/
    – Alexander
    Dec 9, 2012 at 23:08
  • I still don't get why inactive memory isn't vacated when needed, resulting in swapping. I found a solution by just disabling the automatic pager in charge of swapping.
    – Alexander
    Dec 9, 2012 at 23:09
  • Are the panics caused by the SODIMM or the slot? If you switch the RAM sticks' in their slots, do you still get the panics? Have you tried replacing the suspected stick with a different one? Dec 18, 2012 at 10:41
  • The slot; any combination involving it cause kernel panics. I've tried multiple (original) 1GB sticks, and aftermarket 2GB and 4GB sticks.
    – Alexander
    Dec 18, 2012 at 21:03
  • Consider a separate question for the kernel panic. Apr 27, 2013 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .