PDA

View Full Version : Real memory use in Mac OS X?




Infrared
May 27, 2008, 07:25 AM
True. I never, ever, ever put this machine to sleep, therefore, no sleepimage.

I have a couple of questions to ask, if I may:

(1) Is the value returned by that terminal command the same
as the sum of the RSIZE values in Activity Monitor?

(2) Is the value returned the amount of real memory in use by
the OS?

Thanks.

[EDIT]

Hmm.. googling around a bit it looks like /var/vm is the swap file.
So forget those questions were ever asked :)



yellow
May 27, 2008, 07:33 AM
1) No, I don't think so. Just looking at top right now, if I do a quick add up of RSIZE values, it's significantly larger than my current swap file size, which is only 64MB.

2) No, I don't think so. From what I understand of swap, the memory management (in Tiger+) will start out by creating smaller chunks of files to use as swap early on. As uptime, usage, and need grows, the chunks will be larger and larger, but always in octet multipliers (am I expressing that right?).. 64MB, 128MB, 512MB, 1024MB, etc.

Though I don't know if it actually gets to 1GB or higher.

[EDIT]

Hmm.. googling around a bit it looks like /var/vm is the swap file.
So forget those questions were ever asked :)

D'oh! :)

Infrared
May 27, 2008, 07:49 AM
1) No, I don't think so. Just looking at top right now, if I do a quick add up of RSIZE values, it's significantly larger than my current swap file size, which is only 64MB.

2) No, I don't think so. From what I understand of swap, the memory management (in Tiger+) will start out by creating smaller chunks of files to use as swap early on. As uptime, usage, and need grows, the chunks will be larger and larger, but always in octet multipliers (am I expressing that right?).. 64MB, 128MB, 512MB, 1024MB, etc.

Though I don't know if it actually gets to 1GB or higher.

D'oh! :)

Ok, then. That still leaves the pesky question of how one finds out how
much real memory is actually in use.

I'm interested for this reason: there is 4GB of RAM in this Mac. However,
under Vista only 2.81GB is shown as available. The explanation is that
some memory addresses are used to address other devices, e.g., PCI
cards. And that means the memory at those addresses can't be addressed,
can't be used, and so isn't available. Bah! :)

That's under Vista. But the interesting thing to me is how much memory
is available for use under OS X? To find out, I'd hoped to max out the use
of real memory, and work out how much real memory is used then. That
amount should be the amount of memory available to the OS and what is
running under OS. The only difficulty is I can't find a way of determining
how much real memory is in use!

The sum of RSIZE values might get close, but I'm not sure everything that
accounts for the memory used is in that Activity Monitor list.

yellow
May 27, 2008, 08:08 AM
If you have 4GB, Vista should see up to 3GB if you haven't installed SP1, and all 4GB if you have installed SP1. Seems odd that you'd only see 2GB.

"Active" in Activity Monitor is how much real, wired memory is in use. But if you mean real in wired + vm.. I'm not sure. But maximizing RAM usage is going to be a pointless exercise in Mac OS X as all the memory management is handled automagically and isn't changeable by the user. The only you can do as a user is renice a process to give it higher precedence.

Infrared
May 27, 2008, 09:07 AM
If you have 4GB, Vista should see up to 3GB if you haven't installed SP1, and all 4GB if you have installed SP1. Seems odd that you'd only see 2GB.

Firstly, I'm using 64-bit SP1 Vista. Secondly, I'm referring to the
amount that is available for use. With SP1, there is a change in
reporting, but the amount available for use is still likely to be less
than 4GB:

http://support.microsoft.com/kb/946003

How much is available depends on Apple's chipset and the BIOS
(i.e., CSM) implementation.

"Active" in Activity Monitor is how much real, wired memory is in use. But if you mean real in wired + vm.. I'm not sure. But maximizing RAM usage is going to be a pointless exercise in Mac OS X as all the memory management is handled automagically and isn't changeable by the user. The only you can do as a user is renice a process to give it higher precedence.

I wrote a small C program to gobble up RAM through repeated mallocs.

yellow
May 27, 2008, 09:21 AM
I wrote a small C program to gobble up RAM through repeated mallocs.

I see. Well, I'm sure there's much more information about memory management at http://developer.apple.com

Infrared
May 27, 2008, 09:39 AM
I see. Well, I'm sure there's much more information about memory management at http://developer.apple.com

Indeed, if one has a lifetime to spare searching :)

It's common knowledge in the PC world that the RAM installed isn't
necessarily the RAM you get:

http://www.codinghorror.com/blog/archives/000811.html

Don't you think it's odd this is so rarely discussed in the OS X world?

Please don't take this as Mac bashing. I love using this Mac and OS X is
so much snappier than Windows. But I'm curious about this memory thing.

flopticalcube
May 27, 2008, 09:40 AM
Indeed, if one has a lifetime to spare searching :)

It's common knowledge in the PC world that the RAM installed isn't
necessarily the RAM you get:

http://www.codinghorror.com/blog/archives/000811.html

Don't you think it's odd this is so rarely discussed in the OS X world?

Please don't take this as Mac bashing. I love using this Mac and OS X is
so much snappier than Windows. But I'm curious about this memory thing.

What Mac are you using?

yellow
May 27, 2008, 09:43 AM
Don't you think it's odd this is so rarely discussed in the OS X world?


Not really, no.
But I'm not a developer and at this point in the evolution of technology, RAM is cheap and "more is better". ;)




EDIT: FYI, I moved these posts to their own thread.

Infrared
May 27, 2008, 10:01 AM
Not really, no.
But I'm not a developer and at this point in the evolution of technology, RAM is cheap and "more is better". ;)

Indeed. But if more is better, then it would be nice
to know if one has more or less than one thought :)

EDIT: FYI, I moved these posts to their own thread.

Good idea!

yellow
May 27, 2008, 10:26 AM
Seems you already have another one on basically the same issue. No reason not to let the discussion continue there.

http://forums.macrumors.com/showthread.php?t=489727