Best of the Newsgroups: Mac OS X swap, swapping, paging


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):



From: Anthony Lawrence <tony@pcunix.com>
Date: Sun Feb 9, 2003  1:44:41 PM US/Eastern
Subject: Re: Defrag OSX (special case)


Hate these ads?



[[ This message was also posted as:
    <090220031344405215%tony@pcunix.com> ]]



In article <090220031023424926%nospam@iam.invalid>, Mark Conrad
<nospam@iam.invalid> wrote:














> In article <lor1a.40985$2H6.328@sccrnsc04>, Tony Lawrence
> <tony@pcunix.com> wrote:
>
>> However: for most people, the default situation works out fine and 
>> since
>> the swap file was created at first boot, it wouldn't be fragmented, 
>> and
>> subsequent disk activity wouldn't affect it.
>>
>> As you obviously have a spare disk, your best bet would be to dedicate
>> an appropriately sized partition there for swap.
>
> I plan to move my swap files <plural> - to another another spare disk,
> as soon as I learn how, because most of the file-fragmentation occurs
> in the swap files, or so I am told.



Unless you have multiple disks, the best way to manage swap is one
single partition dedicated to whatever you need.  Having multiple swap
files has no advantage unless you can put them on separate disk drives.



>
>
>> So what you are actually talking about is swap.
>
> Mostly, yes, but I would still like to observe a map of an inactive
> UFS-partition to satisfy myself that UFS disk-management is all that it
> is claimed to be as regards to file fragmentation.


ad



>
>> There's no concern about fragmentation of
>> your fs because swap then isn't part of your fs at all.
>
> I hope when you refer to fs that you mean all files in the entire disk
> space, and not just those files that are created in a UFS partition
> when the partition is freshly "initialized", before OSX is even
> installed.



I have NO idea what you mean.  I suspect you are still misunderstanding
swap.



>
>
>> The simple answer is that you decide how much you will need, and
>> dedicate a partition to it.  There's no concern about fragmentation of
>> your fs because swap then isn't part of your fs at all.
>
> It isn't that easy, when it comes to Lisp applications.
>
> Let me explain -
>    First, let me rant and rave a bit about the mind-set of languages
> like C/C++.   The whole idea of those languages is efficiency, so the
> programmer himself is responsible for assigning swap files, assigning
> and later releasing ram (manual garbage-collection or "GC") - by using
> C constructs like malloc, and in general trying to anticipate ahead of
> time what the programs will do and therefore come up with a Grand
> Scheme, all this ahead-of-time.









Completely untrue.  The programmer does NOT assign swap.
>
> Such is the nature of imperative languages like C, and it works fairly
> well as long as highly skilled C programmers are involved.



VM management has absolutely NOTHING to do with C, Lisp or indeed any
programming language.  It's a function of the OS, not your program.



>
> Lisp is completely different, mind-set wise.  The idea of planning the
> Grand Scheme of a program ahead-of-time is a foreign concept to a Lisp
> programmer.  For example, I can't assign swap files ahead of time
> because it is unclear ahead-of-time if they will even be used by the
> "main" program, how large they should be, and other necessary details.
>
> Lisp programs deal with unknown quantities, so the whole idea of
> pre-planning doesn't work well at all. (including assigning swap files)
>
> The reason for using Lisp is generally to tackle a problem which no one
> knows whether the problem can even be solved or not - - - too many
> unknowns, which would drive a C programmer crazy because a C program
> _has_  to be pre-planned in many respects.



You are very, very confused.



>
> Oh sure, I could employ Genetic Programming (GP) to create programs
> which actually "create" other programs on-the-fly, (even capable of
> creating C programs by using CPS techniques) - something like an
> automatic computerized "human" programmer inside my computer, who
> handles the dirty-work of creating the actual desired final program - -
> - in fact I have created "toy" program-writing-programs in the past.
>
> Such GP programs can spawn multiple other programs, which could easily
> overwhelm ram and disk space.
>
> Not even the creator of the "main" GP program knows ahead of time what
> "satellite" secondary programs the computer will decide to create once
> the main Lisp program is started.
>
> .....but the concept of creating "real-world" Genetic Programming
> (program-writing-programs) is definitely the realm of Lisp experts like
> Paul Koza, not me.
>
> I was just explaining something about Lisp in general, with the hope
> that you might understand better why pre-planning things like
> swap-files might not work for me.
>
> Does any of this make sense to you.



You are confused.



First of all, in the best of all possible worlds, you wouldn't have
swap at all because you'd have enough RAM to satisfy every
application's needs.  It is quite possible to run Unix systems with NO
swap if you have sufficient ram.    See
http://aplawrence.com/Boot/swap.html for a more lengthy discussion of
that with examples (it uses a different Unix but the principles apply
to most or probably all modern Unix systems)



Second, for most of us, there's very little or no actual swapping going
on at all: it's paging  that swap gets used for, and much of that is
driven by LRU (least recently used) algorithms, so "fragmentation" is
unimportant.



Third, even if there IS real swapping or large numbers of pages moving
out, fragmentation in the sense it is normally used in the case of a
file system is not generally an issue either because the swap daemon is
free to select contiguous space: it isn't constrained by an existing
file system.








Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner

cartoon
Need eyes on the ground at your customer's site?
Installation and light training Boston and New England
Reliable and experienced, punctual and professional.


Views for this page
Today This Week This Month This Year  Overall
116174 2,624

/Bofcusm/2027.html copyright 1997-2004 (various authors) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - Newsgroup




Unix/Linux Consultants

Your ad here - $48.00 yearly!

http://www.m3ipinc.com Security, firewalls, ids, audits, vulnerability assesments, BS7799, HIPAA, GLB, incident handling


SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at http://opensystemscomputing.com and www.go2unix.com.


http://www.breakthru.com.au SCO (Openserver and Unixware), Unix, Solaris and Linux Consulting services including: Secure Networking Solutions; Linux based Firewalls; Backup Solutions; Secure Home to Office Network Setup; Phone, Remote and On-Site Support available - Satisfaction Guaranteed!



Twitter
  • Nov 18 20:41
    I'll be out all day Wednesday the 19th, hard to reach even by phone. Leave a message and have patience.
  • Nov 18 10:07
    What am I doing? Not doing what I WANT to be doing! Oh, well, in every life a little work must fall..




card_image








Change Congress


Related Posts