Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 2015 11:52:04 +0100
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Is it really necessary to run swapoff on shutdown?
Message-ID:  <20150821115204.39dd7ace@curlew.lan>

next in thread | raw e-mail | index | archive | help

I have two 4GB swap partitions on separate drives on my desktop. By
the time I shut down at the end of the day I usually have about 8% swap
in use.

At an early stage in the shutdown /etc/rc.d/swaplate runs
and takes about one minute to run '/sbin/swapoff -aq'. On some occasions
when more swap has been used swapoff has failed to complete before
timing out.

Perhaps I'm misunderstanding the finer details of managing swap space
but I would have expected that swapoff could be omitted on shutdown. As
each process shuts itself down it will retrieve any swapped out pages
which it needs so by the time the last process is finished none of
the remaining data in the swap space will be required by anything and
can be safely discarded.

Also if it really is necessary to run swapoff on shutdown should the
command have also included the -L option to allow for it having been
used in the swapon command.

-- 
Mike Clarke



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