the nature of RAM? an information question, not about the amount, price, etc

Posted:
in Genius Bar edited January 2014
hey all,

i figure that since you all have boundless knowledge regarding Macs and computers you'll be able to answer my question. Ok, today i installed some more RAM and now have 768mb (). Of course i opened up all my major ram-hogging apps to see how the computer coped when i switched from one to the other. All was well.



Now hours later, when i go into Activity Monitor it says i have 480mb 'Inactive', 77mb 'Wired', 191mb 'Active' and 15mb 'Free' (those numbers are changing as i type, so they might not add up correctly).



For me to increase my 'Free' ram so that my computer recatergorised the 'Inactive' within the same field, would i have to restart?



When i previously had 256mb i used to notice that the computer would start up alright, and run iTunes fine, but if i left it going for hours it would be come slightly more laggy. Is this somehow connected?



Ok, i hope i hope my ramblings make some kind of sense to someone here - i just want to know a bit more about the nature of RAM and how it acts.



Thanks all

Comments

  • Reply 1 of 7
    Wired = RAM used by OS. Cannot be paged onto hard drive.

    Active = Currently in use by applications. Can be paged if necessary.

    Inactive = Previously used by applications and can be reclaimed by the previous application to speed things along if necessary. This is good. Otherwise, any other application can grab it too.

    Free = Not used for anything at all. This is bad.



    When you first start up your machine, there are no previous applications to create "Inactive" RAM, so most of it is "Free". After opening and closing applications, most of the "Free" will be converted to "Inactive".



    Your previous experience is probably due to limited "Free" + "Inactive". In other words, most were either "Wired" or "Active". Paging was probably necessary to remove currently "Active" RAM to make room for other applications. Recall that "Wired" cannot be touched.



    PS - Paging is the process of copying RAM onto the hard drive to free up the RAM. As the hard drive is infinitely slower than RAM. This process is slow.



    Makes sense? Read it again
  • Reply 2 of 7
    cosmonutcosmonut Posts: 4,872member
    Huh. I always figured "Inactive" RAM was a bad thing, unable to be used by ANY app until the computer is restarted. Good to know.
  • Reply 3 of 7
    Quote:

    Originally posted by drumsticks

    Wired = RAM used by OS. Cannot be paged onto hard drive.

    Active = Currently in use by applications. Can be paged if necessary.

    Inactive = Previously used by applications and can be reclaimed by the previous application to speed things along if necessary. This is good. Otherwise, any other application can grab it too.

    Free = Not used for anything at all. This is bad.



    When you first start up your machine, there are no previous applications to create "Inactive" RAM, so most of it is "Free". After opening and closing applications, most of the "Free" will be converted to "Inactive".



    Your previous experience is probably due to limited "Free" + "Inactive". In other words, most were either "Wired" or "Active". Paging was probably necessary to remove currently "Active" RAM to make room for other applications. Recall that "Wired" cannot be touched.



    PS - Paging is the process of copying RAM onto the hard drive to free up the RAM. As the hard drive is infinitely slower than RAM. This process is slow.



    Makes sense? Read it again




    ok. that made sense (thanks), but if you have oodles ( ie plenty) of Free RAM, would the system need to 'page' onto the hard drive? Also, if i were to open i really large, RAM-hogging app, would i see the HD free space decrease? And then increase once i had quit it?



    Just wondering. Thanks
  • Reply 4 of 7
    No, the system will only page if it does not have "Free" and/or "Inactive" RAM. In other words, everything is either "Wired" or "Active". What's the point of paging if there's still RAM that can be used? Remember, "Active" RAM is RAM actually doing something, "Inactive" RAM is RAM doing something by giving the option of repeating results already pre-computed, but otherwise available for any consumption. Tons of "Free" RAM is wasted RAM.



    Note that there are exceptions to this. Like Photoshop for example does some of its own memory management to play nice to other programs.



    If your system needed to page, then yes HDD space will decrease. Page files are generated on a as-needed case. It's located at "/var/vm" and they remain there even after they are not needed anymore. In which case, re-booting will free it up. I can't remember why it's not freed up on the fly though. These files are generated in chunks of 64MB each time (probably more, as you have more of them, ie, first x files are 64MB, second y files are 128MB or something like that - sorry, memory hazy here...)



    Hope that clears things up!



    EDIT: Those page files are not constantly being created. If an old one is no longer needed, it can be used again. For some reason is it not deleted, but it can be used over and over, just like real RAM.
  • Reply 5 of 7
    One more thing, there's always some small amount (about 30MB) of "Free" RAM. This is always reserved for the OS to do emergency stuff, like kernel panics and the like.



    And sometimes when programs terminate, the RAM does not become "Inactive", because some RAM usage can *NEVER* be used again. In this case, it just becomes "Free" RAM.



    It's way past my bedtime... Hope that helps...
  • Reply 6 of 7
    that makes sense about the paging. Thanks for all of this
  • Reply 7 of 7
    No worries...
Sign In or Register to comment.