© 2003 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice
Java Memory Management on HP-
UX
Laksh Venkatasubramanian
HP Java Labs
page 22/8/2005
(c) Copyright Hewlett Packard Company, 2005
HP-UX Virtual Memory Layout
• HP-UX 32 Bit Process
• Four 1 GB Quadrants
A) SHARE_MAGIC
B) EXEC_MAGIC
Shared Text
Shared Objects
(Libraries,
Memory Mapped Files)
DATA (private)
Private Memory Mapped Files
Shared Objects
(Libraries,
Memory Mapped Files)
0x00000000
0xc0000000
0x80000000
0x40000000
Shared Objects
(Libraries,
Memory Mapped Files)
Private Memory Mapped Files
Shared Objects
(Libraries,
Memory Mapped Files)
0x00000000
0xc0000000
0x80000000
0x40000000
Text (private)
DATA (private)
A B
STACKSTACK
page 32/8/2005
(c) Copyright Hewlett Packard Company, 2005
Type of Executables on HP-UX
There are 3 magic numbers that can be used for a 32-bit
executable (11.00 and greater).
/usr/bin/chatr labels the following type of executables in output
• SHARE_MAGIC: shared executable
• EXEC_MAGIC: normal executable
• SHMEM_MAGIC: normal SHMEM_MAGIC executable
For 64 bit (11.00 and greater) executables, there is currently no
need to have different magic numbers available as the standard
one allows up to 4TB for the program text, another 4TB for its
private data and a total of 8TB for shared areas.
page 42/8/2005
(c) Copyright Hewlett Packard Company, 2005
Type of Executables on HP-UX
• SHARE_MAGIC is the default on 11.0. SHARE_MAGIC is also
called DEMAND_MAGIC. With SHARE_MAGIC, quadrant 1 is
used for program text, quadrant 2 is used for program data,
and quadrants 3 and 4 are for shared items.
• EXEC_MAGIC allows a greater process data space by allowing
text and data to share quadrant 1. Quadrant 2 is still solely
used for data, and quadrants 3 and 4 are also the same as with
SHARE_MAGIC executables. EXEC_MAGIC applications are
created by linking the application with the -N option.
• SHMEM_MAGIC makes 2.75 GB of shared memory available to
an application. With SHMEM_MAGIC all of the text and data is
in quadrant 1 freeing up quadrant 2 for shared items. The
SHMEM_MAGIC processes on the system will share quadrant 2
for shared memory, as well as sharing quadrants 3 and 4 with
other processes on the system.
page 52/8/2005
(c) Copyright Hewlett Packard Company, 2005
EXEC_MAGIC vs SHARED_MAGIC
PDC I/O address
space
SameSamePDC I/O address
space
Quadrant 4
0xF0000000-
0xFFFFFFFF
Shared objectsPrivate
Data
SameShared objects
Quadrant 4
0xC0003000-
0xEFFFFFFF
Kernel gateway
page
SameSameKernel gateway page
Quadrant 4
0xC0000000-
0xC0000FFF
Shared objectsPrivate
Data
Private
Data
Shared objects
Quadrant 3
0x80000000-
0xBFFFFFFF
Data and StackSameSameData and Stack
Quadrant 2
0x40000000-
0x7FFFFFFF
Text only and read
only.
Same
SameText starts at the
beginning of this
space and data starts
immediately after the
end of the text.
Quadrant 1
0x00000000-
0x3FFFFFFF
SHARED_MAGICQuad 4
Private
(q4p)
Quad 3
Private
(q3p)
EXEC_MAGIC