Simple swap question

David Naylor naylor.b.david at gmail.com
Fri Dec 19 10:13:41 UTC 2008


On Thursday 18 December 2008 17:16:10 FreeBSD wrote:
> Hi everyone,
>
> I have a FreeBSD 7.0-Release server that started to swap after an error
> in a shell script (process spawning competition ;-) ). I killed the
> shell and the RAM is now OK. The problem is that the swap is still used.
> How can I "reset" the swap?
>
> Thanks for sharing your knowledge,
>
> Martin

Easy:
# swapoff -a ; swapon -a

It just removes all swap devices (with the content mapped back into memory) 
and then turns the swap devices back on.

Just make sure you have enough RAM to run your system while it does this 
(since only the RAM will be available for the system [NO SWAP])!!!  
WARNING: This could kill your system and does eat babies!!!

To others: There is one reason I can think of for doing this, if an 
irregularly used program (that is rather big) has been swapped out but 
requires a low latency when used (i.e. must not wait to be swapped back 
in...) then it would be desired to get the program swapped back into RAM as 
soon as possible after RAM has been freed.  

Regards,

David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20081219/93e2543f/attachment-0001.pgp


More information about the freebsd-questions mailing list