Question Regarding "Page Outs"

Discussion in 'Mac Basics and Help' started by nman040, Sep 16, 2010.

  1. nman040 macrumors member

    Joined:
    Sep 6, 2008
    #1
    Hi,

    I'm currently running a late '06 2.16 MacBook Pro maxed out with 3gb of ram. My MBP has been up for 4 days and the following image has some stats regarding memory usage.


    I'm curious regarding page outs. I know it affects system performance (something to do with data being swapped in and out of ram??) but not really sure how. Mind explaining it to me?

    I don't game nor do I do any photo editing but I do have a number of browser windows, iTunes, Word and the like open.

    Thanks :)
     

    Attached Files:

  2. spinnerlys Guest

    spinnerlys

    Joined:
    Sep 7, 2008
    Location:
    forlod bygningen
    #2
    Mac OS X: Reading system memory usage in Activity Monitor
    Making The Most of Activity Monitor


    Page ins and page outs - could somebody please explain this to me in idiot fashion? found via "page outs"
     
  3. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #3
    You don't have enough RAM for what you're trying to do--by about 5GB by the looks of it (4.8GB swap used on disk). Sort all processes by Real Mem to see what's hogging your RAM. It's likely your web browser(s).
     
  4. nman040 thread starter macrumors member

    Joined:
    Sep 6, 2008
    #4
    Yup, safari is at almost 900mb of real memory. And surprisingly NetNewsWire (an RSS reader) is at 300+mb of real memory- no pages loaded. Other than that it's just Mail and programs alike using about 100mb each.

    Hmm I'm definitely going to get 8GB of ram for my next upgrade. Will probably wait till next year when new Intel chips are released along with USB 3.0 hopefully :)

    New stats a day later:
     

    Attached Files:

  5. Hellhammer Moderator

    Hellhammer

    Staff Member

    Joined:
    Dec 10, 2008
    Location:
    Finland
    #5
    Quit and relaunch Safari. I quit mine frequently as it eats so much memory but after quitting it, it will use less than 100MB of RAM (though that will increase soon). You could try a different browser. I've noticed that Chrome uses less RAM.
     
  6. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #6
    Except the description in that link isn't completely accurate. The poster in that thread said:
    That's not true. "Page in" is transferring a page from the disk to RAM. "Page out" is transferring a page from RAM to the disk.
     
  7. nman040 thread starter macrumors member

    Joined:
    Sep 6, 2008
    #7
    Thanks for that. From what I've seen there's always more Page Ins then there are Pages out. Which is guess is typically the case.

    Some questions:

    1) Which one is "worse"? Page ins or Page outs?

    2) In an ideal world given my current stats how much RAM would provide optimum performance?

    3) And with regards to performance, what kind of tasks would suffer from the need to swap pages to and from the hard disk?

    Thanks again
     
  8. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #8
    Neither. Both are simply a function of normal memory management.
    Your RAM requirements are directly related to how you use your computer most of the time. If you're consistently paging in large amounts, you probably need more RAM. However, even with a sufficient amount of RAM, there may still be occasions where the demands on your system require paging.
    Excessive paging isn't desirable because reading and writing to your hard drive is MUCH slower than accessing RAM. To the extend that your system is paging, your overall system performance will be degraded.
     
  9. Hellhammer Moderator

    Hellhammer

    Staff Member

    Joined:
    Dec 10, 2008
    Location:
    Finland
    #9
    Your computer would be useless if there was no page ins. Page outs are "worse" but they happen even if you had several GBs of free RAM as that is how the OS works.

    3GB should be just fine. I do more intensive stuff with 4GB. A clean install of OS X might help if you have done upgrade installations before and rebooting it by time to time to reset the RAM is also wise.

    All tasks. Even opening a new tab will be slowed down if there is not enough free RAM because data has to be moved to the HD and as HD is so slow, that causes beachballing.
     
  10. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #10
    So why are page outs worse when both page in and page outs involve disk i/o?
     
  11. nman040 thread starter macrumors member

    Joined:
    Sep 6, 2008
    #11
    Thanks Hellhammer and GGJstudios. Your responses are enlightening.

    My system was running really slow on my 7200rpm 200GB Hitachi HD after what I would think is severe fragmentation over 2 years. Also with about 10-20GB of disk space left at any given time didn't help matters. Spotlight in particular was unusable.

    I recently upgraded to a 500GB Seagate Momentus XT (a hybrid HDD with 4GB read-only SSD built-in). It boosted performance significantly. However, after an uptime of several days I feel the system getting bogged down (but nowhere as bad as before) for tasks simple tasks and as you have pointed out Hellhammer, even opening tabs. I deduced that it was an issue with lack of memory and hence this post.

    Questions:

    1) Is it possible to keep computers running with an uptime of say several weeks without encountering slowdowns due to insufficient memory?

    2) Assuming an SSD is in place (in probably a better system than mine) and with memory still being a bottleneck, could one expect the same slowdowns? Or does running an SSD significantly help matters?

    Slightly off-topic:
    3) Getting back to my old system which the HDD almost maxed out. Besides the insufficient amount of HDD and RAM.

    a- How much would fragmentation of the HDD affect system performance? I was told that UNIX based systems don't really need to be defragmented compared to their Windows counter parts

    b- Does frequent movement of large media files (several GBs at a time) make fragmentation worse? I constantly download HD stuff from iTunes and after my HDD is almost full (with maybe 8GB of free space), I would move them off to my external HDD. The cycle repeats.

    Sorry for the never-ending questions. Just curious how everything is related.

    Thanks again :)
     
  12. jdavtz macrumors 6502a

    Joined:
    Aug 22, 2005
    Location:
    Kenya
    #12
    Page Ins don't really matter too much, they happen when the OS decides to move something that's in RAM to the hard drive, because it realises you're running low on RAM. I think this is done kind-of pre-emptively, rather than waiting till RAM is 100% full then moving data out to make space at the exact moment you need it. If it's data that you don't access again, then there's no issue.

    If you DO need to access that bit of data again, then you need to "Page Out" the data from the hard drive - THAT is what is slow.
     
  13. Hellhammer Moderator

    Hellhammer

    Staff Member

    Joined:
    Dec 10, 2008
    Location:
    Finland
    #13
    Page in = From disk to RAM
    Page out = From RAM to disk

    Everything that needs HD access is slow but the reason why I would say page out is worse is because when you run out of free RAM and OS starts to page out, even the simplest tasks lag, such as opening a new tab. It's something in our mind. Opening a new tab usually works immediately but often opening a big app like Photoshop takes its time. Thus we get frustrated when opening a new tab lags because we have got used to the idea that it works immediately but when opening Photoshop, we're not in hurry because it always takes its time when opening it for the first time because it's paging in.

    Maybe not the best example but I tried to come up with something that makes sense. Neither of them is exactly bad but page ins you can't get rid of but page outs you can try to minimize with more RAM. If I'm talking bullcrap, please correct me
     
  14. maccompaq macrumors 65816

    maccompaq

    Joined:
    Mar 6, 2007
    #14
    In my years of experience with Mac and Windows, I find that it is best to turn off the computer at the end of the day. Macs are notorious for memory fragmentation (memory leaks). The only way to flush the memory is to do a reboot.
     
  15. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #15
    I monitor vm/swap file usage, and when I see more then 5 swap files, I typically see some performance degradation. Given my desktop has 6gig of ram, this does not occur everyday, but only after running for about a month without rebooting.

    For some reason, I run into some serious performance issues with vmware when I have a high volume of swap files, I'm not sure if its a memory leak on fusion's part or what but it kills the performance to a level that a reboot is required.

    Unlike windows, OSX is built on unix and has some great memory management. As mentioned I can go a solid month maybe even longer w/o rebooting. My work desktop needs to be rebooted almost on a daily basis.
     
  16. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #16
    Page ins happen when you launch a program or when you access a new part of the program, so these are flat out unavoidable. Page outs only happen when the kernel needs to create a new page but can't (nothing free, and nothing unmodified), so it takes a chunk of data that a currently running program needs in order to run that it can't already get from disk (e.g. it can reread the application itself from disc, but it can't reread your new unsaved word document), and it moves it to the hard drive. When it's needed next, it's moved back from the HD, and something else is swapped out of RAM.
     
  17. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #17
    I strongly disagree. If you close all of your programs and shut down, all of those programs and the operating system itself have to be reread from disk.

    Memory fragmentation is not the same as memory leaks. OS9 (and older) had problems with memory fragmentation because all programs had a limited contiguous chunk of memory. OS X applications may have problems with memory leaks, but not the OS itself. Apple's generally good about this.
     
  18. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #18
    You're not talking bullcrap or "drunk posting" as spinnerlys sometimes does (he usually admits it when he does! :D) The reason I said neither page ins or page outs are bad is there are many in this forum who freak out if their battery health drops from 100% to 99% or if their screen seems a bit brighter from one day to the next. It wouldn't be good for those folks to be obsessing over Activity Monitor readings, as well.

    OK, I know everyone here is fairly computer literate, but I'm going to give my RAM explanation for the zero-computer-literacy crowd. I know it's extremely basic, so forgive me, but it might help a few who stumble on this thread in the future. This is not intended to be a technical "white paper", but rather, an explanation of the concepts.

    Imagine working with paper documents on a small desk (small amount of RAM) and having the requirement that any page you work on requires it's own space on the desk (no stacking). All your documents are stored in a filing cabinet (hard drive) 3 floors down, accessible only by the stairs. On any trip to or from the filing cabinet, you can only carry one page.

    You start with a clean desk (boot up) and as you start to work, you first must retrieve pages from the filing cabinet, one page per trip (page in). When your desk fills up, in order to make space for more work, you must first take a page from the desk (usually the one that's been unused for the longest period of time) and return it to the filing cabinet (page out). Then you have space to retrieve a page from the filing cabinet and put it on your desk (page in).
    ScreenCap 3.PNG
    As you can imagine, with a small desk, you'll be spending most of your time running up and down the stairs to the filing cabinet. If you get a larger desk (more RAM), with more space for pages, you can make fewer trips to the filing cabinet, leaving you more time to do actual work.

    Yes, if you have a reasonable amount of RAM. In my experience, Mac OS X does a much better job of releasing RAM than Windows did. With Windows, frequent reboots were necessary to clear RAM and make the system run faster. I frequently run several weeks uptime on the Mac, with no noticeable degradation in performance.
    Having an SSD is like having a filing cabinet only 2 floors down, rather than 3 floors down. It's an improvement, but still not as helpful as more RAM.
    In the overall scheme of things, fragmentation under Mac OS X is the least of your worries when looking to improve performance.
    Again, Mac OS X does a much better job of handling fragmentation than Windows does, in my experience. However, having a small amount of free space can affect paging performance (imagine the filing cabinet almost full and having to take longer to find a space to file things, to be over simplistic.)
     

Share This Page