HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 35 (of 101)
Chapter 11 Software Development
October 29, 2013
T
e
x
t
Heap
Heap
heap
s
t
a
c
k
Heap
un-
used
*1
s
h
l
i
b
s
h
l
i
b
shlib: shared library
*1: can be used to increase the heap, for additional shared libraries
or to map regions
Remember that maxdsiz and ulimit must be set high enough. Of course the amount of memory
a process can allocate is also limited by the amount of virtual memory (swap space). So if there
is not enough available, all these techniques are useless.
Allowing Shared Data in Q2
As mentioned earlier in this section, per default only Q3 and Q4 can hold shared memory
segments. This limits the total amount of shared memory in the system to ca. 1.75 GB. This limit
can be raised to 2.75 GB by changing Q2 from private to shared usage:
chatr M prog ### PA-RISC
chatr +as shmem_magic prog ### IA64
This change is only possible for EXEC_MAGIC executables, else there would be no quadrant left
for private data. The address space for SHMEM_MAGIC executables will look like this:
Q1
Q2
Q3
Q4
T
e
x
t
heap
Un-
used
*1
s
t
a
c
k
un-
used
*2
s
h
m
e
m
un-
used
*2
s
h
m
e
m
s
h
m
e
m
un-
used
*2
s
h
l
i
b
un-
used
*2
un-
used
*2
s
h
l
i
b
un-
used
*2
s
h
m
e
m
shmem: shared memory segment
shlib: shared library
*1: can be used to increase the heap
*2: can be used for additional shared memory segments and shared libraries
Note that Q3 and Q4 cannot be private in a SHMEM_MAGIC executable. While chatr(1) will
allow setting the appropriate flags without giving an error message, execve(2) will
return ENOEXEC when trying to start the program.