Programming with Judy
Tuning HP-UX Memory Access
The chatr Command
Chapter 5 55
5 Tuning HP-UX Memory Access
Like other kinds of arrays, Judy arrays can potentially consume large
amounts of memory. Because of this you should be aware of some HP-UX
features that directly affect memory performance and the amount of
memory you can access.
The chatr Command
The chatr command changes a program's internal attributes and can be
used to modify the data page size for a specific executable. The larger the
page size, the fewer virtual-to- physical, memory-page translations your
process has to undergo. This can have a dramatic effect (sometimes 2X)
on the performance of data-intensive (RAM) applications.
For programs that use less than 64 MB of data space, use
chatr +pd L a.out
to allow the page size to grow from 16 Kb to 32 Kb or 64 Kb and up to the
maximum it needs.
For programs that use more than 64 MB of data space, use
chatr +pd 64M a.out
This command causes the a.out to start with large pages (64 MB) and
limits the page size to 64 MB, so that page sizes that are too large cannot
cause a premature out of memory condition. For example, if you are
using a 1GB page size and only have 0.99 GB left, the page allocation
may fail (you run out of memory even though you have almost a gigabyte
left).