4 ms·
That's not what pageouts as reported by OS X refer to. Try the following experiment: 1) Open two Terminal windows. 2) Run top in one of them. 3) Note the
by othermaciej 14y ago
That's not what pageouts as reported by OS X refer to. Try the following experiment:
1) Open two Terminal windows.
2) Run top in one of them.
3) Note the pageout number.
4) In the other, type echo foo > bar.txt
5) Refer again to pageout number.
You will see that it did not increase, even though the system just wrote to a file. This will be the case even if you wait a while.
On OS X, the reported pageouts are dirty memory pages being tossed, not writes of files to the filesytem.
Your definition also does not match the historical distinction between swapping and paging and the distinction you draw is idiosyncratic. Originally, swapping referred to swapping out all of a process's memory, while paging is done in chunks. No system has true "swap" in this original sense any more, so the terms "swap" and "page" are now basically interchangeable.
- otterley 14y agoEverything I said is true for at least for Linux, where files are memory-mapped into the process space, and swapped page counts relate to anonymous pages (look at /proc/vmstat for the gory details; note that pgpgin/out and pswpin/out increment under different conditions). OS X may admittedly be different. It's unfortunate that it doesn't expose more counters to help show what's really going on. As for "reported pageouts are dirty memory pages being tossed" - where are they being tossed to, if not the filesystem?
- jonhendry 14y agoOn OS X files aren't memory-mapped by default.
- othermaciej 14y agoThey are usually being tossed to the pagefile (except in the case of read-write non-anonymous file mappings, which are not super common on OS X and which are functionally equivalent to paging to the page file anyway).