Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Inactive memory *should* be freed up, but for some reason OS X doesn't always.
No, not necessarily. If the inactive memory maps the contents of a file (program file for example), there is no need for OS X to forget this fact just to make it free. If the RAM is needed for something else it can take this inactive memory just as easily as if it was free.

Remember that inactive memory is available memory with known potentially useful contents. Free memory is available memory without useful contents; in effect it is wasted memory.

I don't think virtual memory really means much. The virtual memory numbers are more accurate in SL (in leopard, even the smallest programs had like 1gb), but activity monitor is showing my total VM size at 118GB.

There is nothing strange about your computer using 118GB virtual memory in total. This is just the sum of the defined address ranges of all processes. Many pages in a process is shared with lots of other processes (program code, or because the process has forked). Other pages are defined, but are not yet allocated either in RAM or in a swapfile (happens often when a process allocates memory and before actually using it).

You are right though that the fact that your computer uses a total of 118GB virtual memory doesn't mean much.
 
pesc, I fully agree with you. But one question have been bothering me for a long time already:

Why do Mac and Windows always live free memory quite large and don't use all available memory for inactive (system cache)? For example, at the moment, I have 1 GB of free memory and 1.33 GB of inactive memory. And I can't make inactive (cache) memory bigger by reading additional files—Mac just removes data of some other files from cache, but doesn't use available free memory for cache.
 
No, not necessarily. If the inactive memory maps the contents of a file (program file for example), there is no need for OS X to forget this fact just to make it free. If the RAM is needed for something else it can take this inactive memory just as easily as if it was free.

Remember that inactive memory is available memory with known potentially useful contents. Free memory is available memory without useful contents; in effect it is wasted memory.

I realize this is an old thread, but I'll reply anyway.

What I meant was, inactive RAM should be freed up when something calls for it (although I didn't make that clear in my post). The problem I'm having is that when I have say 2GB of inactive RAM and 0 free RAM, if I open VMWare Fusion, OS X will start swapping the inactive RAM to the disk. Since the RAM is not needed any more, presumably it can be regenerated from something already on the disk (the application that created it), so it is redundant to swap it out. When something calls for RAM and there is only inactive RAM, OS X should drop the inactive RAM (and I think this is the intended behavior), but instead it seems to swap it.

@danilcha
OSes don't put stuff into inactive RAM because they don't really know what would be best to put there. They might prefetch some stuff, but if they tried to keep all memory in use all the time, people would complain that the OS hogs RAM and that it is always thrashing the disk in the background (common complaints with Vista). If the OS did this on battery power, people would complain that the computer gets hot and has short battery life. I agree that it would be better if OSes found a way to use more RAM without any detrimental effects to the user, though.
 
m85476585, when a program asks for some memory, inactive memory is just occupied—it is not "swapped". It is the fact.

Why do you think that it is OS X "swapping" inactive memory to disk? Why isn't it WMware who does something with disk?
 
m85476585, when a program asks for some memory, inactive memory is just occupied—it is not "swapped". It is the fact.

Why do you think that it is OS X "swapping" inactive memory to disk? Why isn't it WMware who does something with disk?

Page outs and swap used go up in Activity Monitor when this condition happens, and the computer beachballs. If I start VMWare when there is enough free RAM, nothing is swapped to the disk (page outs and swap used remain at 0). Everything is acting as if inactive RAM is not actually free.
 
The problem I'm having is that when I have say 2GB of inactive RAM and 0 free RAM, if I open VMWare Fusion, OS X will start swapping the inactive RAM to the disk.

VMWare Fusion is not an application like others. There is a whole operating system in its own right running inside it. If you give VMWare 2 GB of RAM and run Windows inside, VMWare will grab those 2 GB, and Windows runs the same as on a 2 GB PC.

And Windows has this habit of loading lots of things from hard drive into RAM when it starts (remember it thinks its on a PC all on its own, it doesn't know there is a Mac as well that suffers and slows down when Windows uses the computer too much), and that will slow you down. Most likely, MacOS X isn't doing anything, but Windows is.
 
If I have enough free RAM in OS X, everything is fine. Of course Windows uses the disk, and VMWare takes up a lot of RAM, but everything runs smoothly for the most part, and I can keep using programs in OS X with minimal interruption. If I don't have enough free RAM in OS X, even with plenty of inactive RAM, the whole thing runs really slowly and beachballs (making everything else on OS X essentially unusable) for a while until OS X has swapped enough to the disk to make room for VMWare.
 
m85476585, I have just tried to do the same with Photoshop. It looks like you are right. When I have little free mem, but plenty of inactive, it starts to swap.

The problem, however, may be not because of OS, but because of Photoshop and WMware, which allow themselves to use free mem only. I will try now with dd count=1024 bs=1m
 
Yeah, the problem is in OS. I have just tried to execute

dd bs=1500m count=1 if=/dev/zero of=/dev/null

while having only 1.3 GB free. It really starts to write something to disk. After that inactive mem decreases and I have 1.5 GB of free mem.

According to https://forums.macrumors.com/threads/875202/ it seems that it is Snow Leopard problem only.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.