John’s Oracle Experiences

My everyday experiences with Oracle products

A little short on swap space ?

Posted by John Paul van Helvoort on December 24, 2008

In some cases its handy to quickly be able to adjust your swap.
Here is a little trick i mostly use to do so.

First you can check your physical memory total :

grep MemTotal /proc/meminfo

To check your swap space total :

grep SwapTotal /proc/meminfo

So if you find yourself short in swap space , lets say for an Oracle installation.
You can safely expand your swap space like this

$>su - root
( You have to be root to be able to do this)

$>dd if=/dev/zero of=tmpswap bs=1k count=900000
( 900000 being 900 Megabytes )

$>chmod 600 tempswap

$>mkswap tempswap

$>swapon tempswap

Whenever you want to remove this extra swap space, use these commands :

$>su - root

$>swapoff tempswap

$>rm tempswap

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>