Operating System - HP-UX
1854684 Members
31166 Online
104102 Solutions
New Discussion

Re: SHM Memory Management

 
SOLVED
Go to solution
gm200
Occasional Contributor

SHM Memory Management

I'need to know how can be manage a SHM memory problem:
On the same HP Superdome machine I need to generate two different Shared Areas for two different users by using executable programs (32 bit compiled). I have set the attributes of each program at SHMEM MAGIC (chatr -M). Each pogram requires to allocate about 3,7 GB of SHM memory size. The problem is that I don't manage allocate the two shared memory areas at the same time. If the first of them is allocated the program runned by the second user don't found enough memory size free to allocate the second SHM area.
How can I resolve the problem?
In this case it's possible use the memory windows option? If yes how can I set the sistem to use that feature?

Thanks
GM200
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: SHM Memory Management

You definitely need to be using memory windows otherwise all 32-bit processes share a common 4GB address space; with memory windows, each group of releated processes gets a separate 4GB address space.

Just go to docs.hp.com and search on "Memory Windows" -- you should find plenty of information.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: SHM Memory Management

You definitely need to be using memory windows otherwise all 32-bit processes share a common 4GB address space; with memory windows, each group of related processes gets a separate 4GB address space.

Just go to docs.hp.com and search on "Memory Windows" -- you should find plenty of information.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor
Solution

Re: SHM Memory Management

32bit programs are severely limited in memory addressing based on today's standards. The shared memory area is a single map so all shared memory segments must frit into the maximum space available. Thus, your two programs can only run at the same time if their shared memory segments total less than 3.7Gb. The best solution is to recompile the code as a 64bit application in which case your limit will now be in the terabytes.

For memory windows, make sure you are up to date on patches, change the kernel to allow some windows (perhaps 5 or 10) and then start the programs with setmemwindow. Note that ALL programs that will use the same shared memory area must be started with setmemwindow.

What happens is that the kernel creates a new memory map for each window, so each program now has a private area for shared memory. See the man pages for setmemwindow and max_mem_window.


Bill Hassell, sysadmin