Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Swap space requirements on 10g installs - must it really equal RAM?

RE: Swap space requirements on 10g installs - must it really equal RAM?

From: <>
Date: Tue, 4 Oct 2005 18:19:39 -0400
Message-ID: <>


We just ran into a shortage of swap on our Solaris 9 box w/ 32GB of pyhsical RAM. Your SA is wrong about Solaris 9 not allowing more than 4GB of swap. When we ran into the problem, we had 12GB configured. We now have 2x RAM, or 64GB.
 $ swap -l

swapfile             dev  swaplo blocks   free

/dev/md/dsk/d1 85,1 16 25175408 25175408
/dev/vx/dsk/prerac2_swapdg/san_swap1 278,30000 16 114041840

$ swap -s
total: 11541760k bytes allocated + 9175248k reserved = 20717008k used, 72014224k available

So, clearly the OS can see and use more than 4GB. (Time for a new SysAdmin? ;-))

Second, a bit about our problem, and why we have configured such a large (absurd?) amount of swap.

We had a 32GB box, w/ 12GB of swap. We are running, 64-bits, and though I don't think it's relevant to this discussion, this box has RAC configured.

With 12GB of swap, we never noticed any problems. Several weeks ago, I cranked up SGA_MAX_SIZE to 10GB, even though we were only using around 4GB at the time. Even with several hundred (dedicated) connections, total RAM utilization was way below the 32 GB that this box had. Well, last week, we started seeing some load related performance problems. One of the things I identified is that if I grew our default, keep, and recycle buffer caches, I ought to be able to significantly reduce some I/O. So, I did that, and it seemed to help.....until we hit our peak load part of the day, and suddenly Oracle connections are dying with TNS-12500-->TNS-12540-->TNS-12560-->TNS-00510-->Solaris Error 12: Not enough space. Well, it didn't take long, searching on MetaLink, to discover that meant swap space shortage. A little more searching, and I found two different papers citing that best practice for Oracle on Sun was that swap should be at least 2x physical RAM.

That seemed a bit excessive, but, with production servers down and you know the problem is shortage of swap space, are you really going to quibble over a few dozen GB of disk? Disk is (relatively) cheap. So, I told the sysadmin to go to 64GB of swap. Since we've done so, we've not had any further incidences.

One of the things I read (in Solaris Internals: Core Kernel Architecture by Mauro and McDougall), was that when a process starts up, an amount of swap equal to the memory of the process is "reserved". As that memory is actually used, a corresponding amount of swap is "allocated" from *physcial* swap as "backing store". This is required so that (quoting Mauro and McDougall) "an out-of-swap-space error can be reported synchronously during a system call."

This seems to imply that you absolutely need at least 1x RAM just to be able to effectively use all (or, nearly all) the RAM? This makes a certain amount of sense to me, but my doubt is rooted in my sysadmin's opinion that I've got this wrong. He claims that there's no one-to-one mapping of physical RAM consumed and physical (disk) swap consumed. And this from a sysadmin who seems to be pretty sharp and on the ball on all other counts and in my previous experience with him. Anyone with intimate knowledge of Solaris internals have any input?

Anyhow, the extra swap has solved the problem, and our server is happy, so the customer is happy, so my bosses are happy, so I'm happy....


-----Original Message-----
[] On Behalf Of Goulet, Dick Sent: Tuesday, October 04, 2005 4:54 PM
To:; Subject: RE: Swap space requirements on 10g installs - must it really equal RAM?


        I use HP-UX or RedHat vs Solaris & we set swap to 2 times ram. The reason is that swap gets used to hold an image of the operating process for diagnostic purposes in the event of a system crash. If we had less than ram for swap we could not start enough processes to use all of ram.

-----Original Message-----
[] On Behalf Of
Sent: Tuesday, October 04, 2005 3:00 PM
Subject: Swap space requirements on 10g installs - must it really equal RAM? Hello,

When installing 10G on dev and QA I had gotten the error that we should configure swap space to equal RAM. Since I figured out 4G of swap space was more than enough (why would we need 16G of swap space?) I ignored it, installed the software, created the database, and had no problems.

But one of the other DBAs was doing the production install and when he saw the message he balked and opened a TAR with Oracle. The Oracle support tech said that you *should* have swap set = to RAM. To be precise they said:

"...the database should not be installed on a machine having less than a 1:1
ratio of RAM to swap.

I would not advise skipping this message."

Speaking with one of the SAs he said the system won't even recognize more than 4G of swap.

Does anyone know of any reason why we would need more than 4G of RAM or (preferably :) why this isn't really important. Documentation for the latter would also be nice as I would now have to convince my management that this isn't necessary even though Oracle said it was.

Oracle 10.2
Solaris 2.9
4G Swap

Jay Miller
Sr. Oracle DBA

This message is confidential and sent by TD Waterhouse solely for use by the intended recipient. If you are not the intended recipient, you are hereby notified that any use, distribution or copying of this communication is strictly prohibited. This should not be deemed as an offer or solicitation, to buy or sell any product. Any 3rd party information contained herein was prepared by sources deemed reliable, but is not guaranteed. TD Waterhouse does not accept electronic instructions that would require an original signature. Information received by or sent from TD Waterhouse is stored, subject to review, and may be produced to regulatory authorities or others with a legal right to such.
Received on Tue Oct 04 2005 - 17:23:14 CDT

Original text of this message