Operating System - HP-UX
1831213 Members
2752 Online
110021 Solutions
New Discussion

ENOMEM returned while executing pthread_attr_init on HP11i

 
Suresh Ollala
New Member

ENOMEM returned while executing pthread_attr_init on HP11i

Hi
I have compiled ACE 5.2 on HP 11i and my application uses it to spawn threads. While executing the call pthread_attr_init i get a return code of 12. sys/types/errno.h has the following #define for error code 12.
#define ENOMEM 12

This indicates that there is not enough memory left on the device whereas my ulimit shows the following
[69] % ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 267324
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 2048

i also tried on some other machine with the limits as given by the following
[101] % ulimit -a
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 60
[102] %

but on this also i get the same error code. Is there any other parameter which i need to set ?

Does anyone have an idea about the various conditions that can give rise to this error ?

Also maxdsize on mysystem has a value 66831
Thanks
Sonali
6 REPLIES 6
Mark Grant
Honored Contributor

Re: ENOMEM returned while executing pthread_attr_init on HP11i

You could be out of swap.
Never preceed any demonstration with anything more predictive than "watch this"
Umapathy S
Honored Contributor

Re: ENOMEM returned while executing pthread_attr_init on HP11i

Sonali,
You may be out of swap space. Check with swapinfo -mt. Check the swapmem_on kernel param.
HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
A. Clay Stephenson
Acclaimed Contributor

Re: ENOMEM returned while executing pthread_attr_init on HP11i

Ulimit is a necessary but not sufficient test. You are probably hitting the "hard" limits imposed by the kernel. Check the values of maxdsiz (and if this is 64-bit code) maxdsiz_64bit. I also note that you have left the maxssiz at 8MB and this is typically a little small. I would increase maxssiz to 32MB or so -- which should be plenty. You will need to increase these values and then gen a new kernel.
If it ain't broke, I can fix that.
Suresh Ollala
New Member

Re: ENOMEM returned while executing pthread_attr_init on HP11i

1. swap space is set to 4gb
2. maxdsize is set to 277MB, this is what my sam shows

-Suresh
Mark Grant
Honored Contributor

Re: ENOMEM returned while executing pthread_attr_init on HP11i

You need to look at the reserved swap figure.Try "swapinfo -mt" and see what percentage of total is being used. A process in HP-UX reserves swap that it might need later even if it is never used.
Never preceed any demonstration with anything more predictive than "watch this"
Suresh Ollala
New Member

Re: ENOMEM returned while executing pthread_attr_init on HP11i

# swapinfo -mt
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
reserve - 178 -178
memory 3029 374 2655 12%
total 7125 552 6573 8% - 0 -