Real memory use in Mac OS X?

Discussion in 'Mac Programming' started by Infrared, May 27, 2008.

Thread Status:
Not open for further replies.
  1. macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #1
    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 :)
     
  2. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    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! :)
     
  3. thread starter macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #3
    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.
     
  4. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    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.
     
  5. thread starter macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #5
    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.

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

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #6
    I see. Well, I'm sure there's much more information about memory management at http://developer.apple.com
     
  7. thread starter macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #7
    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.
     
  8. macrumors G4

    flopticalcube

    Joined:
    Sep 7, 2006
    Location:
    In the velcro closure of America's Hat
    #8
    What Mac are you using?
     
  9. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #9
    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.
     
  10. thread starter macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #10
    Indeed. But if more is better, then it would be nice
    to know if one has more or less than one thought :)

    Good idea!
     
  11. Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #11
Thread Status:
Not open for further replies.

Share This Page