PDA

View Full Version : What exactly is 'inactive memory' and what is reserving it.


dogbone
Sep 23, 2005, 08:49 AM
Looking at my acivity monitor I have shut everything down and except for safari and the activity monitor.

I can see that all the items listed in the monitor add up to about 260Mb of real memory.

There is 100Mb Wired, I suppose that has to do with the net.

There's 266Mb Active I suppose that is all the things i can see in the monitor.

There's 790Mb Inactive Don't have the slightest clue what that is all about but it goes a long way to explaining why I only have about 420Mb free.

What is that huge chunk of Inactive memory and what does it mean for example if I want to open a bunch of large Photoshop files. Does that Inactive memory rob Photoshop of Ram it could use?

Can anyone point me towards an article that explains exactly how OSX and G4's use ram. It used to be so clear with OS9.

So at the moment even though I've not got anything open I'm using over a gig of ram.

Say I wanted to do some heavy duty work with Photoshop would I be better off restarting first or would that have no effect.

lexfuzo
Sep 23, 2005, 09:15 AM
Does that Inactive memory rob Photoshop of Ram it could use?
Can anyone point me towards an article that explains exactly how OSX and G4's use ram. It used to be so clear with OS9.
Say I wanted to do some heavy duty work with Photoshop would I be better off restarting first or would that have no effect.

Nono, OS X will take care of assigning RAM to the app which needs it. This was not the case with OS9.

You might want to read John Siracusa on the topic:
http://arstechnica.com/reviews/os/macosx-10.1.ars/7

It's not new but the principle is still valid.

Applespider
Sep 23, 2005, 09:21 AM
If you had Photoshop open and then you quit it, the memory that it had been using will show up in inactive memory.

If you decide to open Dreamweaver and need to use that memory, OS X will take the inactive memory and allocate it to new applications.

But, very cleverly, if you happen to open Photoshop again while its inactive memory is still there (simplistically speaking), OS X will be able to load it faster since bits of it are still in memory.

Don't worry about not having free memory; any large amount of free memory is wasted since it's not doing anything. Let OSX work out how to handle it; it does a pretty good job. It's only if your pageins/pageouts number gets excessively high in a short period of time that you know you need more memory.

dogbone
Sep 23, 2005, 09:31 AM
Thanks lexfuzo, I'll have a read of that.

Appleinsider, ah yes I think I get it now. So I can consider 'inactive memory' effectively as 'free ram'.

What is this page in page out number. (I haven't read the article yet so it might be in there) at the moment it's 38000/0 what would be considered excessively high. I'll go read the article now.

lexfuzo
Sep 23, 2005, 10:05 AM
What is this page in page out number. At the moment it's 38000/0 what would be considered excessively high.

PageIn and -Out refer to parts of memory that are written to disk (swap space) from RAM or read from swap into RAM again. The OS tries to do this as little as possible. The numbers accumulate over time. What's your uptime? The fact that PageOut is zero is a good sign mthat your RAM is sufficient.

deryk
Sep 23, 2005, 10:13 AM
PageIn and -Out refer to parts of memory that are written to disk (swap space) from RAM or read from swap into RAM again. The OS tries to do this as little as possible. The numbers accumulate over time. What's your uptime? The fact that PageOut is zero is a good sign mthat your RAM is sufficient.

I'd like to second dogbone's question. What is a decent pagein page out ratio to uptime?

NEoPHYte31
Sep 23, 2005, 10:47 AM
I'd like to second dogbone's question. What is a decent pagein page out ratio to uptime?

What would be an ideal ratio?

lexfuzo
Sep 23, 2005, 11:28 AM
What would be an ideal ratio?
I don't know how this should be expressed in numbers. It depends not only on uptime, but on the activity as well.
Two rules-of-thumb would be:
1) the lower the better - anything with 5 digits for some days of use is quite right
2) As long as you don't experience the following, you're good with RAM:
An app performs something which doesn't need high disk-I/O (such as opening a menu) and is very slow at that while the HD is grinding. This means that the OS has to PageIn that the app can allocate the memory for the menu. When this happens at a usual amount of simultaneous activities on your machine, you should get more RAM.

deryk
Sep 23, 2005, 11:39 AM
I don't know how this should be expressed in numbers. It depends not only on uptime, but on the activity as well.
Two rules-of-thumb would be:
1) the lower the better - anything with 5 digits for some days of use is quite right
2) As long as you don't experience the following, you're good with RAM:
An app performs something which doesn't need high disk-I/O (such as opening a menu) and is very slow at that while the HD is grinding. This means that the OS has to PageIn that the app can allocate the memory for the menu. When this happens at a usual amount of simultaneous activities on your machine, you should get more RAM.

Thanks for your response. I have noticed pagein and pageout on my stats monitor, but I had no idea what that was and I have not given it much thought.

I have not experienced that issues you stated in point number 2, so I bet I have enough RAM for my needs.

(post 100 after 2.5 years!)

Makosuke
Sep 23, 2005, 03:05 PM
Ideally for page ins/outs, you will see zero outs--that means the OS has never needed to swap *anything* to disk. Non zero isn't necessarily a big deal--the data being swapped may have been something very unimportant from a RAM-hungry app that doesn't really use all of it--but zero is ideal.

The number of ins, so far as I understand it, isn't important, since that's just the number of pages an app needed to load into memory. It will, by definition, go up every time you launch an app you didn't have open before, since that app of course needs to load stuff. Generally it *won't* go up by much the 2nd time you open an app, thanks to that handy "inactive" RAM--the data it needs is already sitting in RAM, and so doesn't need to be paged in.

Now, if the system is paging a bunch of stuff out to disk then loading it back in, both numbers are going to go up at a frightening pace, and that's when your system slows down--on a smoothly running system the page ins shouldn't change much when you're not opening apps (or using an app's feature for the first time, so it has to load it), while on a system that's thrashing, it'll be cranking up constantly.