Some ideas for FreeBSD

Jerry McAllister jerrymc at
Fri Feb 8 17:41:35 UTC 2008

On Fri, Feb 08, 2008 at 09:16:52AM -0800, millueradfa at wrote:

> --- "Jason C. Wells" <jcw at> wrote:
> > Heiko Wundram (Beenic) wrote:
> > > Am Donnerstag, 7. Februar 2008 07:32:16 schrieb
> > Jason C. Wells:
> > >> Norberto Meijome wrote:
> > >>> But I agree with you really want to
> > use swap files?
> > >> One could mount an md filesystem and then use
> > that as swap.  That way
> > >> you wouldn't need to use any disc space.  As a
> > plus, the performance
> > >> would be way better than disc.
> > > 
> > > Ahem, sorry, that's just plain stupid. Either the
> > md system is backed up by 
> > > RAM (in which case you don't need the swap anyway;
> > why'd you want to access 
> > > RAM by putting it in a swap on an md in RAM?), or
> > it's backed up by swap, in 
> > > which case you have a chicken and egg problem.
> > 
> > Mmm, yes. That is quite a pickle.  But a chicken or
> > an egg would still 
> > be inferior to an md backed swap. :)
> > 
> > Regards,
> > Jason
> > 
> > _______________________________________________
> > freebsd-questions at mailing list
> >
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe at"
> > 
> Actually, you can have file backed swap files. I have
> done it. However, with more than one swap file, or a
> swap file and a swap partition on the same disk, there
> ends up being quite a bit of thrashing. This is due
> apparently to some interaction between having two
> swaps on the same disk but that is jut a guess, i dont
> know what the cause is. 
> The idea behind having swap files is that swap space
> can more easily be expanded and added on the fly. If
> your initial swap partition was not big enough it is
> more easy to more swap in another file. As well, a
> swap file that can grow and shrink, also would allow
> you to avoid having a lot of disk space consumed by
> unused swap, so he disk space is allocated when
> needed, or allow more space to easily be added if you
> find out you do not have enough. 
> With applications crashing because of swap partition
> running out, this would be an important feature, since
> more swap space can be allocated in a file which is
> easier to do than a partition.
> Swap is still important on systems with small amounts
> of RAM, FreeBSD should be able to run on some older
> hardware too and should not be like Windows where you
> have to have 2 GHZ 2 GB of ram to run it. dynamic swap
> space makes it more versatile which is a good thing

The question here is not whether to have swap, but to have md
as swap.   It seems like that would cause more problems with
speed and probably thrashing that just plain swap partitions
on disk.

Now, the abiliity to use a file as additional swap can be
important because it will allow you to add some swap in a pinch
without reconfiguring your disk or adding disk - which a larger
or additional swap partition would require.   

But, a swap file is not something you want to run with as a matter 
of course.  You want a swap partition.   Writing and reading a
swap partition is optimized for that in a way that writing to a 
file system cannot easily be optimized.

At least that's what my mom told me.

>       ____________________________________________________________________________________
> Looking for last minute shopping deals?  
> Find them fast with Yahoo! Search.
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list