Should I be worried that I always seem to get "Page Outs" from my MacBook's RAM?
March 25, 2008 12:44 PM   Subscribe

Should I be worried that I always seem to get "Page Outs" from my MacBook's RAM?

Using a MacBook C2D with 2GB of RAM. The machine doesn't feel under-powered and I use it moderately (read: I don't tend to run a thousand apps concurrently).

I've noticed that I always gets "Page Outs" from the RAM -- I'm using iStat menus to notice these things.

For example, here's what I get 5 hours after rebooting with only Azureus open. And as I'm typing this, the machine is now open for about 2 days and I've got nearly 250,000 page outs.

I ran MemTest to check whether I got faulty RAM sticks -- it gave me 0 errors after a 1280% scan (i.e. it scanned the RAM in full almost 13 times).

What's going on? Do I have faulty RAM? Or should I ignore the "Page Outs" and move along?

Thanks in advance for your help!
posted by kchristidis to Computers & Internet (17 answers total) 2 users marked this as a favorite
 
Everything is fine. Page outs are completely normal, they're just the way the computer's virtual memory system works. Nothing to worry about.

(556 page outs is only 2.1 MB of data, which is completely miniscule.)
posted by xil at 12:49 PM on March 25, 2008


no big deal

It's a normal Unix memory function
posted by Oktober at 12:50 PM on March 25, 2008


Why do you think a 'page out' indicates something is wrong? They are an entirely normal part of virtual memory management.
posted by 0xFCAF at 12:50 PM on March 25, 2008


Page outs have nothing to do with memory faults. They happen when you're trying to hold more things in memory than you have RAM capacity, and the OS decides to store some of it on your hard drive instead.
posted by fvw at 12:51 PM on March 25, 2008


Best answer: It's more like a verb. The system has temporarily run out of physical ram, so it pages what it needs to store out to disk. You're fine. In fact, if you were NEVER paging out, it'd be very unusual, but you'd be AWESOME!
posted by tcv at 12:58 PM on March 25, 2008


Best answer: What paging out is: moving data from RAM (very fast memory) to the hard drive (fairly slow, but HUGE). Paging in is moving it the other direction, the whole process is called swapping. Hence the file on the hard drive where that data gets put is called the swap file. or pagefile. or whatever they decided when they built the OS.

Extending what tcv said, the operating system can page for several different reasons. The biggest one, is that you are trying to run more stuff than you have room for. You have 2 gigs of RAM, so you probably don't hit this that often, especially when you say you don't run a thousand apps concurrently).

Another reason to swap is because the operating system can make better use of the ram. Conceptually (ie. this isn't exactly how it works), imagine you have Safari running in the background, and it hasn't done anything for five minutes. Not one execution. It is taking up some amount of memory, and that memory isn't being used for anything. The operating system swaps out the process, and uses that newly freed memory to cache other things you accessing often. Not for additional programs, but for data that it is guessing you will need soon. So next time itunes asks for a chunk of the song off the disk, OSX has already grabbed it, and just hands it back out of memory.

Regarding what fvw said. A memory fault is a software error, not a hardware error. It is when software tries reading values from outside the sandbox the operating system gave it.

Let me know if you have further questions, but basically the sum total of that long answer is that nothing at all is wrong. Your computer is doing exactly what it was programmed to, and is actually faster and more responsive for it.
posted by cschneid at 1:31 PM on March 25, 2008


Response by poster: To everyone asking why I think something is wrong: it's most probably due to my ignorance, but I remember Googlin' it a few months ago (when I had no idea what this "Page Outs" thing means) and reading that PageOuts is a sign that things are bad with regards to RAM.

I'm glad to find out that it's a completely normal function and even high numbers such as mine (~280k PageOuts after ~48 hours) aren't something to worry about. (Right?)

xil, Oktober, 0xFCAF, fvw, tcv, cschneid: thank you all for taking the time to help! (cshneid -- thank you for the incredibly detailed answer!)

One last question, since we're talking RAM: should I be worried about my PageIns though? As we speak (48 hours uptime), they're ~2,100,000.
posted by kchristidis at 3:30 PM on March 25, 2008


No, you shouldn't worry about your page-ins either. A page-out is when the computer moves data from memory to disk, and a page-in is just the opposite: Some program needs to access something that used to be in memory but has been paged-out to the disk, so the computer pages it back in meaning that it reads the data from the disk and puts it back in memory so it can be used.
posted by Juffo-Wup at 3:46 PM on March 25, 2008


Best answer: Say you do paperwork in an office: Think of your desk being like your computer's memory and your large filing cabinet being like your computer's hard drive. You can access papers that are sitting on your desk very quickly, but there is a limited amount of room available on your desk. It takes a little longer to get papers out of the filing cabinet, but you can store a lot more papers in there than you can on your desk. Likewise, your computer's memory is much faster to access than your computer's hard drive, but there is a lot less storage space available in memory than on your hard drive.

As you do paperwork at your desk, your desk may begin to get cluttered or even if it's not especially cluttered, you may find that there are papers on your desk that you won't need to look at again for quite a while.

In these cases, you might decide to move the papers from your desk into your filing cabinet. This is conceptually equivalent to a page-out: You move the data (the papers) from a place where you can access them quickly but where there is a limited amount of space to a place where there is plenty of space, but it takes slightly longer to access things.

Eventually, you may find that you need to look at some papers that are in the filing cabinet. You would go to the cabinet, find the papers, and put them back on your desk so that you can work with them. This is analogous to a page-in.
posted by Juffo-Wup at 3:56 PM on March 25, 2008 [2 favorites]


Response by poster: Man, you guys are good. Killer analogy, Juffo-Wup!
posted by kchristidis at 3:57 PM on March 25, 2008


Best answer: A memory fault or page fault is not (necessarily) an error. It is a failure, but generally a recoverable one, and it is initiated by the hardware memory management unit (MMU,) and handled by software in the operating system. The word “fault” in this context doesn’t connote “faulty,” but is more like the geological term indicating a separation or boundary. The separation in question is that between “pages” or blocks of memory. (The operating system deals with blocks of memory rather than individual bytes because it’s usually more efficient to move data in larger chunks, and programs tend to access data in contiguous memory locations.)

The operating system allocates a certain range of memory for each running process. In a virtual memory system, this range can be much larger than the actual physically available RAM. (You can use the Activity Monitor to see how much virtual memory is allocated to each program—as I type this, Safari alone occupies 1.2GB of virtual memory on my system which only has 1GB of RAM.) The operating system deals with this by using the disk as secondary storage for program data. So, it may come to pass that the program tries to access some data in a page that isn’t loaded in RAM, but is held in “swap space” on the disk. The operating system clears out a portion of RAM, stores (pages out) that data in the swap space if it’s “dirty,” and retrieves (pages in) the needed data from disk, putting it in RAM, at which point the program can resume operating as normal.

This process is called faulting, paging, or swapping, depending on who you ask, and which specific event you are talking about. Should you be worried about page outs? No; they are a quite normal occurance in modern operating systems. Launching an application will frequently produce a large number of paging operations, as will performing some memory-intensive operation such as a Photoshop filter on a large file. (On my system, I just launched Firefox, and the total count of page ins increased by about 2100.)

However, excessive paging can cause “thrashing,” where the system gets into a situation where it just cannot get all the requested data into RAM and degrades into doing no real work, just repeatedly paging in and out.

The aggregate total count of page ins or page outs isn’t really useful information, but if you have a way of measuring the number over a short time period, that will indicate if there is a problem. Thousands of paging operations per second may indicate thrashing; hundreds of thousands, or even millions over a few days is well within the range of normal. But if you are sitting near the computer, the churning noises coming form the disk, and general unresponsiveness are just as good for indicators of excessive paging.
posted by ijoshua at 7:14 PM on March 25, 2008


Response by poster: That was an excellent and informative reply, ijoshua. I don't see any signs of thrashing, so I guess I'm good!

Thank you for taking the time to write this.
posted by kchristidis at 7:57 PM on March 25, 2008


Best answer: When you're running application programs, modern operating systems will often use exactly the same underlying mechanism to get access to the contents of the program files as they do to get access to the contents of the swap file. So you'll likely be seeing a bunch of page-ins for each program you're running. The contents of those program files don't change, so there's no need for the OS to do a page-out when it wants to free up a little space - it just "drops the page on the floor" instead. That's why you'll generally see more page-ins than page-outs.

With 2GB of RAM installed, I'd be surprised to find your computer thrashing. If it did, I'd suspect that one of your long-running application programs has a "memory leak" - a condition where the app keeps on asking the OS to allocate it some RAM, and then forgets to let it know that that RAM is free again when it's done with it. Memory leaks, again, are not a fault in your computer - they're bugs in the programs you're using.
posted by flabdablet at 8:26 PM on March 25, 2008


With 2GB of RAM installed, I'd be surprised to find your computer thrashing

After about 20-25 days of use, my 2GB 10.4 system runs out of memory and starts thrashing. Bunch of apps using 50-100MB and usually a couple of monsters with 500+.

And for the original question, Page Outs are not as significant performance drag compared to Page Ins. A process doesn't have to wait for a Page Out to complete, but it does wait for a Page In to complete.
posted by tachikaze at 10:21 PM on March 25, 2008


Those monsters will be the ones with memory leak bugs. Stop or restart those, and all should be well again for the next few weeks.

Many people have reported that the Firefox web browser has memory leaks. I haven't experienced that myself, but then, I don't run many extensions, which are commonly held to be the most prevalent cause of Firefox memory leaks.
posted by flabdablet at 3:25 AM on March 26, 2008


Response by poster: I'm stunned by the fantastic replies I keep receiving on this thread.

flabdablet, tachikaze thank you both for your input.

"So you'll likely be seeing a bunch of page-ins for each program you're running."

A-ha, that explains it.

For the record, I just rebooted my machine -- just launching Azureus alone resulted in ~30,000 pageIns. Fun!
posted by kchristidis at 8:34 AM on March 26, 2008


A page is usually 4096 bytes, so 30,000 page-ins is what, 120 megabytes of disk reads? Sounds about right for modern software.

I still have fond memories of the first personal computer hard disk drive I ever played with. It was a thing called the Cameo, for the Apple ][+, and it was a huge chunky box with a massive 5 megabytes of disk capacity. Everybody thought it was cool because it held as much as 34 Apple ][ floppy disks did, and transferred data at a blistering 30 kilobytes per second instead of the 4 kB/s that the floppies were generally good for. You could load a picture directly into the high-resolution graphics screen in the blink of an eye!

Not that much later, I worked for a firm that made an Apple ][-compatible hard disk using one of the new miniature 5.25" hard disk mechanisms, and employed DMA to achieve an average 90 kB/s on disk file reads, and we thought that was fast.

And now, launching a single application program on a modern personal computer apparently requires reading 25 times the entire capacity of the Cameo drive. Strokes grizzled old beard, mumbles into coffee... I had an onion on my belt, which was the style at the time.
posted by flabdablet at 5:20 PM on March 26, 2008


« Older Timeframe from pitch to product on shelf?   |   Learning new languages during my commute! Newer »
This thread is closed to new comments.