Why do I get swap space related errors when I still have lots of free memory in Solaris 10?

Posted by Tom Duckering on Server Fault See other posts from Server Fault or by Tom Duckering
Published on 2010-04-14T20:32:50Z Indexed on 2010/04/14 20:43 UTC
Read the original article Hit count: 197

Filed under:
|
|

I am seeing a few of my services suffering/crashing with errors along the lines of "Error allocating memory" or "Can't create new process" etc.

I'm slightly confused by this since logs show that at the time the system has lots of free memory (around 26GB in one case) of memory available and is not particularly stressed in any other way.

After noting a JVM crash with similar error with the added query of "Out of swap space?" it made me dig a little deeper.

It turns out that someone has configured our zone with a 2GB swap file. Our zone doesn't have capped memory and currently has access to as much of the 128GB of the RAM as it need. Our SAs are planning to cap this at 32GB when they get the chance.

My current thinking is that whilst there is memory aplenty for the OS to allocate, the swap space seems grossly undersized (based on other answers here). It seems as though Solaris is wanting to make sure there's enough swap space in case things have to swap out (i.e. it's reserving the swap space).

Is this thinking right or is there some other reason that I get memory allocation errors with this large amount of memory free and seemingly undersized swap space?

© Server Fault or respective owner

Related posts about solaris

Related posts about swap