Alex Rivera | Logout

Trouble Understanding Inactive Memory in MacOSX

Asked 2011-04-01T09:05:46.690
9

I thought that I understood how MacOSX manages memory, but recently I’ve become baffled by its performance. Here is the situation:

  1. I have a brand new Core i7 system with 8GB of physical memory running MacOSX 10.6.7.
  2. There are a few Apps running regularly taking up some of the memory—Safari, Mail, Xcode, Terminal, etc.
  3. I need to run three 64-bit processes in parallel, each of which uses about 2000M of real memory.
  4. Although the wired memory stays below 1000M (i.e. I have over 7000M available for processes), I see heavy paging activity leading to very bad performance from the three memory-intensive processes that I launched.
  5. Apparently, I am not running out of available RAM, as the reported inactive memory stays around 2500M and the active memory doesn’t rise above 5000M.

Can anyone give me a clue as to why MacOSX does not release the inactive memory for the processes that need it, instead resorting to paging? Also, is there any proper way to influence the memory management by the system?

The only thing that has come to my mind is that the 32-bit kernel might be the limiting factor, although I’m not sure why. I know that you can boot MacOSX with a 64-bit kernel, but then I won’t be able to load a number of 32-bit Apps, so that’s not an option for me.

Edit
Report

1 Answer

1

There are evident problems in memory management in os x ...

please, take a look at my post: MAC OS X Lion performance problem - broken memory management also, i recorded a screen video, where the system starts to hang when all the free memory is gone, and inactive memory is 4-5 GB ! MAC OS X Lion performance problem - screen video

what i did ... I run the tar+bzip command, which is basic unix stuff, on the large amount of picture files, in my Pictures/ folder. Just before start, i run the "purge" command, to delete inactive/cached program data.

You can see on the video that free memory starts to drop very fast, and inactive is constantly rising. If you take a look at "bsdtar" command, it takes only a fragment of RAM, so the problem is not in this process. You cannot say that it is a program memory leak, because then the problem would not be in inactive ram, rather in active/wired.

When the free memory dropped below 100mb, i started some apps, like Safari, iPhoto and MS Word, and you can see in the video, that it takes even minutes (!) to start an app, when normally (when there is free RAM), it would take some 3-5 secs to load.

answered 2012-04-24T08:48:22.840

Your Answer