Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Feb 2007 13:53:14 -0800 (PST)
From:      Aloha Guy <alohaguy123@yahoo.com>
To:        Scott Long <scottl@samsco.org>
Cc:        questions@freebsd.org, current@freebsd.org
Subject:   Re: swap file vs swap partition
Message-ID:  <393982.95591.qm@web53614.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Thanks for the input.  You do have good points.  The only issue with swap p=
artitions is that it seems like you need to increase it everytime you incre=
ase the physical memory.  Is there a swap partition size limit that pretty =
much will handle anything and setting a number larger than that will really=
 not offer anything?=0A=0AJohn=0A=0A----- Original Message ----=0AFrom: Sco=
tt Long <scottl@samsco.org>=0ATo: Aloha Guy <alohaguy123@yahoo.com>=0ACc: q=
uestions@freebsd.org; current@freebsd.org=0ASent: Sunday, February 4, 2007 =
12:16:37 PM=0ASubject: Re: swap file vs swap partition=0A=0A=0AAloha Guy wr=
ote:=0A> Greetings everyone:=0A> =0A> I am planning to build a few new boxe=
s which will run -RELEASE and -CURRENT and I have a question about the swap=
 file.  In the past, I had always used a swap partition of 256MB since I or=
iginally had 128MB system memory in the 1990's but my system has been upgra=
ded to 2GB and it seems the swap file would have more flexibility as I can =
just change the size of the swapfile if I needed to. My question is is ther=
e any difference in performance between a swap file versus a swap partition=
 and can one run a system with a swap file instead of a swap partition?=0A=
=0AYes.  A swap file requires a pass through the filesystem code in order=
=0Ato figure out where each block is.=0A=0A> Also, searching has not gotten=
 me very far but are there any drawbacks to a swap file instead of a swap p=
artition?  I read somewhere that a few people seem to think that a swap fil=
e can't handle kernel crash dumps?=0A=0AThat's correct, it cannot.=0A=0A> S=
houldn't it be the same as both of them occupy disk space and as long as th=
e swap file is large enough, wouldn't it work?=0A=0AThe crashdump code is w=
ritten to assume that the dump space is=0Acompletely contiguous, something =
that is not at all guaranteed by=0Aa swap file.  While it would certainly b=
e possible to modify it=0Ato make a pass through the filesystem like above,=
 the intention=0Aof the crashdump code is also to be as simple as possible =
and to=0Adepend on as few kernel services as possible.  When the system has=
=0Acrashed, who knows what can be trusted anymore, right?  Also, filesystem=
=0Acorruption is a frequent cause of crashes; why risk that dumping to=0Aa =
swapfile might encounter corruption and trash your entire filesystem.=0A=0A=
Scott=0A=0A=0A =0A_________________________________________________________=
___________________________=0AGet your own web address.  =0AHave a HUGE yea=
r through Yahoo! Small Business.=0Ahttp://smallbusiness.yahoo.com/domains/?=
p=3DBESTDEAL



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?393982.95591.qm>