Page in/out counts - Good? Bad? Ugly? Other?

Discussion in 'Apple' started by Don Bruder, Jul 25, 2010.

  1. Don Bruder

    Don Bruder Guest

    Nothing critical, just curious -

    Got an AGP G4 running 10.4.11 with 960 megs of physical RAM.

    $ uptime
    23:51 up 44 days, 18:02, 2 users, load averages: 0.76 0.77 0.51

    A few seconds later, opening up Activity Monitor and kicking over to the
    System Memory pane shows 1027860 page ins, and 73376 page outs.

    I haven't been noticing any particular problems or anything like that,
    but I got curious and took a look, and now that I've looked, I don't
    know if what I'm seeing is good, bad, in between, or "Oh My God!
    Emergency Action Needed!"

    I've never really seen a good, clear explanation of precisely what the
    page-in/out counts mean (nothing I've seen has been much more in-depth
    than "it has to do with virtual memory and is related to how much
    physical memory you have and how many programs you try to run at the
    same time, along with how memory hungry they are") so I'm just plain not
    sure what to make of the numbers I'm seeing.

    Anyone?
     
    Don Bruder, Jul 25, 2010
    #1
    1. Advertisements

  2. Don't know if MacOS does this, but the way a program starts in VMS (e.g.
    "image activation") is to load the first 512-byte "page" of the program
    in a fresh virtual address space starting at the 2nd page because that
    first is mapped as "no access" by the hardware so that null pointer
    errors cause a memory access exception. Then set the program counter to
    0x200 and let the program run. When the program accesses addresses
    outside the range that's mapped in memory, the memory pager maps more of
    the program into memory. The larger the program, the more the page-ins.
    Or the more programs are run, the more page-ins. Other OSs may do it
    differently but once a program is running, it's actual address space can
    grow theoretically to the maximum size of virtual memory. Got lots of
    large programs running or lots of small programs running then exiting?
    That may affect page-ins.

    If this doesn't make sense, read up on Virtual memory. Wikipedia has
    pages on it, I'm sure. Or just remember

    virtual means not knowing where your next byte is coming from...
     
    Michael Vilain, Jul 25, 2010
    #2
    1. Advertisements

  3. Don Bruder

    David Empson Guest

    In my experience:

    1. The "Page ins" count goes up all the time as part of normal activity.

    As a result, the "Page ins" counter has little or no diagnostic value.

    Many files (including applications and data files) are loaded into
    memory using a mechanism whereby the file is "mapped" into the virtual
    memory space, so the content of that file forms part of the virtual
    memory. A "page in" is then used to read information from the file
    (virtual memory) into real memory (RAM) when that part of the virtual
    memory is accessed.

    2. A nonzero value in the "Page outs" count almost always indicates a
    situation where your computer needed more real memory (RAM) than is
    installed.

    It is possible for the same file mapping scheme described above to be
    invoked for the purposes of writing information out from real memory to
    virtual memory in normal operation of an application, but this is
    relatively rare.

    The most common reason for a "page out" is that the computer needed more
    real memory for something, but none was available. It therefore has to
    pick some area of memory which was not recently used, and write it out
    to a "swap file" to make room for something else. This causes the "Page
    outs" count to increase.

    If there is heavy page out activity, it is usually associated with
    loading something else into memory, so this tends to result in a lot of
    hard drive activity, and the computer goes very slowly. You will not
    enjoy the experience as you will be seeing spinning beachballs and
    pauses.

    The solution is generally to add more real memory to the computer, or to
    reduce the amount of memory required, e.g. by not running quite so many
    applications all at the same time, or to reduce the memory required by
    some of those applications.

    The "Page outs" counter in Activity monitor can be a useful tool to
    diagnose whether the computer has enough memory for a particular task.
    If you have Activity Monitor running and you see the "Page outs" counter
    increasing, then at that moment the computer does not have enough memory
    for whatever it is doing. If it is increasing rapidly then you may have
    a major performance hit.

    A static reading in "Page outs" on a system with a high uptime is not
    useful in itself, as there is no information about whether that number
    appeared in a single rapid burst (one application needed a vast amount
    of memory), or in moderate sized bursts each time a particular
    application was launched (that application needed a fair amount more
    memory than you have), or on occasions when lots of applications were
    run at the same time (run fewer applications at once), or it was
    trickling over time (which may not even be noticed by the user) due to
    having only slightly insufficient memory during certain tasks.
     
    David Empson, Jul 25, 2010
    #3
  4. Don Bruder

    Bob Harris Guest

    1027860 pageins in 44 days is 16 pageins per minute
    73376 pageouts in 44 days is 1 pageout per minute

    Just remember there are lies, damn lies, and statistics.
    Averaging the values can put things into perspective.
    Then do not worry about it.
    Others have explained where the pagein/pageout numbers come from.

    If you decide you want to see when those events happen, you can
    open an Applications -> Utilities -> Terminal session and run

    sar -g 60 100

    Which will report the number of pageouts once a minute for 100
    minutes (change the values to suite your tastes)

    Now let this run while you do your normal tasks. You can go back
    and look at the output and see where your pageout activity
    occurred, and correlate with what you were doing at the time.

    Years ago, I had a G4 Mac tower with 640MB. It mostly ran OK, but
    I noticed slowness when I switched between applications. Using
    the above I noticed that when I switched, there was a burst of
    pageout activity as the application I was switching to, was paged
    back into memory, and something already in memory was paged out.

    I increased the memory to 1.5GB and things were greatly improved.

    Bob Harris
     
    Bob Harris, Jul 25, 2010
    #4
  5. The 'top' command will give you live stats. Page-ins and page-outs are
    a normal part of modern operating systems. Both happening at the same
    time is often a symptom of needing more RAM.
     
    Kevin McMurtrie, Jul 25, 2010
    #5
  6. Don Bruder

    Don Bruder Guest

    Heh... Yeah, that too! :)
    I'm nowhere *NEAR* "worried" about it. But when my "curious bump" gets
    to itching, you betcha I'm gonna try to scratch it!
    Yep, I see that now that there's been time for responses to be made/get
    to my server.
    Something to try one of these days.
    FWIW, since I posted the original message, page ins have gone to 100518,
    while page outs have remained unchanged at 73376. Clearly, I'm paging
    "in" a whole helluva bunch more than "out".

    Equally clearly (now) it's a "nothing to worry about" concept. I simply
    didn't have any idea if I was looking at "be afraid!" or "who cares?"
    numbers. It now seems fairly obvious that the numbers I'm seeing fall
    pretty solidly into the "unless you're curious, who cares?" category.
    I don't have much in the way of plans for bumping the RAM in this
    particular rig - As of right now, it's my "primary backup" machine -
    It's not giving me anything resembling trouble, and besides, it's
    *SUPPOSED* to be my secondary rig, but I just haven't had the ambition
    to actually pull the pieces out of it and transfer them into the DP MDD
    that's nominally my "primary" and is sitting just to my left.

    The MDD is maxed out at a full 2GB, and it's waiting for me to
    (eventually...) transplant the USB2 card, third-party airport card, and
    misc other improvements out of the AGP and be physically moved into
    place as "primary". For now, it sits there (relatively) quietly helping
    me test my code, and every now and again, opening up a second copy of
    Diablo II for "mule work". One of these days...

    Speaking of "quietly"... This MDD is one of those afflicted with the
    known "extraneous ticks, clicks, buzzes and whirrs" in the sound system
    issue - at least, it is when I just plug a set of speakers into the
    sound-out jack. Anybody know (before I go to the effort of clearing
    space and moving it into range of the USB cable that feeds the DSS-80s
    currently plugged into the AGP with less than 2 inches of slack to
    spare) if that problem goes away if/when I plug in something like a set
    of Microsoft DSS-80 speakers via USB?
     
    Don Bruder, Jul 25, 2010
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.