[Info-vax] swap and page files

Paul Sture nospam at sture.ch
Thu Jan 3 09:46:10 EST 2013


In article <kbqfko$k21$1 at dont-email.me>,
 Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:

> On 2012-12-30 21:50:45 +0000, Johnny Billquist said:
> 
> > Run an OS X box for a month without rebooting, and it will be paging 
> > heavily, and the results are much worse than an old VMS box.
> > Todays machines (well OSes) are designed for regular reboots.
> 
> For some cases, uptime is great.   Uptime isn't always a panacea, and 
> it can sometimes be a siren.  Everything's working...  Or appears to 
> be...
> 
> > The memory is used rather aggressively for disk caching, and eventually 
> > you'll be out of memory, and your processes will be paging a lot, since 
> > disk caching is regarded as a more useful usage of memory than for 
> > processes.
> 
> Interesting.  Was that with 10.8?  Or 10.7?  Or earlier?

My experience of 10.3 to 10.5 (PPC client versions) was that OS X would 
allocate new swapfiles in chunks of increasing sizes when required, 
something like this:

128 MB swapfile0
128 MB swapfile1
256 MB swapfile2
512 MB swapfile3

and so on, with the precise sizes varying as successive versions 
introduced refinements to the algorithm (and usually produced better 
performance on the same hardware).

The swapping/paging algorithm would actively try to reduce these when 
memory demands allowed.  In many cases simply by quitting all 
applications and waiting a while, OS X would trim those swapfiles back 
to just one or two.  If some process happened to be occupying the larger 
swapfiles, this wouldn't happen, but normally a logout/login would 
restart such processes in a way which allowed aggressive trimming to 
occur.  If you had restarted the any of the network components they 
could be sitting "up there" and the trimming might not happen of course.

As I understand it, memory reclamation got a rework in 10.7 with the aim 
of keeping apps around after exit but I skipped that version so have no 
first hand experience of its behaviour.

"Something is deeply broken in OS X memory management (Lion performance 
problems part 3)"

<http://workstuff.tumblr.com/post/20464780085/something-is-deeply-broken-
in-os-x-memory-management>

and 

"Mountain Lion update: possibly fixed."

<http://workstuff.tumblr.com/post/28556080639/mountain-lion-seems-to-have
-partially-addressed-the>

-- 
Paul Sture



More information about the Info-vax mailing list