1833016 Members
2850 Online
110048 Solutions
New Discussion

Maximum shared memory?

 
Martin Robinson
Frequent Advisor

Maximum shared memory?

We have a SAP system, well several actually. On an A-class with 1GB RAM, SAP insist that shmmax is set to 1GB. Is this wise? I realise that just because you CAN allocate 1GB of shared memory, you don't have to.

But am I right in thinking 1) shared memory cannot be paged out 2) allocating as much shared memory (or more) than physical memory can lead to application failure and/or kernel panics?
5 REPLIES 5
Armin Feller
Honored Contributor

Re: Maximum shared memory?

Rammig Claus
Frequent Advisor

Re: Maximum shared memory?

Hi Martin,

yes your right,

1) shared memory cannot paged out
2) if an application needs more shared memory as available the application start failes

If your system has 1 GB RAM, there is no need to size shmmax to 1GB, cause the theoretic maximum is (1GB - Size of Buffercache - Size of Kernelstructures)

have fun
Claus
No risc no fun
Bill Hassell
Honored Contributor

Re: Maximum shared memory?

Shared memory is subject to severe limitations for 32bit application programs. The maximum addressable shared memory area is slightly less than 1000megs. BUT: this area is shared with memory mapped files, shared libraries and other programs that use shared memory.

The kernel parameter shmmax controls the maximum size of a shared memory area and is simply a fence to prevent bad programs from grabbing too much memory. By changing the way you link your application programs, apps can request memory up to 1750megs.

Now all these limits apply *only* to 32bit programs. 64bit programs have no practical limits (shared memory up to 8,000Gbytes). But, 1Gb is *way* too small to run SAP with any reasonable performance. The minimum system RAM should be 4Gb. Allocating most of RAM to shared memory will not cause a kernel panic, but all the applications will be paging (swapping) constantly resulting in 50-100x performance degradation. For SAP and Oracle, small memory systems will be severely crippled.


Bill Hassell, sysadmin
harry d brown jr
Honored Contributor

Re: Maximum shared memory?

Frank Slootweg
Honored Contributor

Re: Maximum shared memory?

> 1) shared memory cannot paged out

Just for the record: Shared Memory *can* be paged out. Perhaps Shared Memory *used by SAP* can not be paged out, but in general, Shared Memory can be paged out. For details, see the SHM_LOCK and SHM_UNLOCK commands of shmctl(2).