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

HP-UX Handbook Rev 13.00 Page 30 (of 101)
Chapter 11 Software Development
October 29, 2013
Usually no program has as much code to fill the whole quadrant, so it only uses the beginning of
the quadrant, the rest of its address range will not be is used. All data in the first quadrant is read-
only. A process is not allowed to modify its code, because HP-UX will share one instance of the
program code if multiple processes are running the same program.
Q2 holds the private data of the process. All addresses of program variables must lie within its
address range. This sets an absolute limit at 1 GB for the maximum amount of private data a
process can allocate.
Q3 and Q4 are used for shared text and data.
This is an example of address space usage of a process:
Q1
Q2
Q3
Q4
t
e
x
t
unused
(wasted)
heap
un-
used
*1
m
m
a
p
s
t
a
c
k
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, or to map more private regions
*2: can be used for additional shared memory segments and shared libraries,
or to map shared regions
The memory of 64-bit processes is also organized in 4 quadrants, but because of the larger
address space, each quadrant has a size of 4 TB. Also, the quadrant usage is different:
Quadrant
Address Range
Usage
Q1
0x00000000 00000000 - 0x000003ff ffffffff
shared text/data
Q2
0x40000000 00000000 - 0x400003ff ffffffff
text
Q3
0x80000000 00000000 - 0x800003ff ffffffff
private data
Q4
0xc0000000 00000000 - 0xc00003ff ffffffff
shared text/data
Q1 is used for shared data here to allow sharing between 32-bit and 64-bit processes, using the
same addresses.