Operating System - HP-UX
1836981 Members
2161 Online
110111 Solutions
New Discussion

Re: shared memory allocation fails with error number 12

 
Sathish C
Frequent Advisor

shared memory allocation fails with error number 12

Guys
We are running HP9000 11i with ost of the boxes with 16G,8G,48G of physical memory , we have a process that loads huge amount of data into the memory from flat files , this process fails in few boxes with error number 12 , this process requires about 2.5 3G of memory but even if the system has 7G free still it fails , the shmmax is set to as high as the memory in that box , can someone shed some light to this problem .
Some cause happiness wherever they go; others, whenever they go
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: shared memory allocation fails with error number 12

First things first.

1) Are you compiling as 64-bit code?
2) Eventhough you have plenty of memory, do you have sufficient virtual address space. ie How much swap space and is pseudoswap enabled?
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: shared memory allocation fails with error number 12

I also note that you are definitely falling the the range limit for 32-bit SHMEM_MAGIC executables - 2.75GB which strongly suggests this is 32-bit code.
If it ain't broke, I can fix that.
Sathish C
Frequent Advisor

Re: shared memory allocation fails with error number 12

Yes it is 32 bit code and swap space is reasonable is set to as what the physical memory is , do you suggest to increase it by two .The instresting thing is , this program is not faling ( atleast so far ) on a box where the physical memory is just 8G .
Some cause happiness wherever they go; others, whenever they go
A. Clay Stephenson
Acclaimed Contributor

Re: shared memory allocation fails with error number 12

Well, there's your answer. It's 32-bit code. The absolute maximum is 2.75GB and that is only with SHMEM_MAGIC enabled. I suspect why your are seeing different results in that the shared memory is being allocated out of global address space and that is why it works on some boxes and not on others. It depends on what else is running on each box.
You can make the behavior consistant by using "Memory Windows" which give each group of related process its own 4GB VAS rather than being shared by all processes. Go to docs.hp.com and enter "memory windows" as a search key.

To really solve your problem, you need to compile as 64-bit code and thus eliminate the 32-bit restrictions. No matter what you do, your absolute maximum (and it is difficult to achieve) in 32-bit land is 2.75GB of shared memory.
If it ain't broke, I can fix that.
Sathish C
Frequent Advisor

Re: shared memory allocation fails with error number 12

Hi
Are you sure about 2.75G , is it not 1.75G , please confirm this .
Some cause happiness wherever they go; others, whenever they go
Steve Steel
Honored Contributor

Re: shared memory allocation fails with error number 12

Hi

This is all good info but is there a difference on the boxes that fail.

Patching memory swap 32 or 64 bit system

Worth checking

Memory windows is best idea

Well explained at

ftp://eh:spear9@hprc.external.hp.com/memory.htm


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)