Common Misconfigured HP-UX Resources (April 2006)
Buffer Cache Hash Table
Blocks in the buffer cache are hashed so that they can be accessed quickly. The number of hash
entries is computed at boot time and is one-quarter of the number of free memory pages rounded up
to the nearest power of two. Therefore, a system with 12 GB of memory will have approximately one
million hash table entries regardless of the buffer cache configuration. A page is 4,096 bytes, thus
12 GB represents 3,145,728 pages. One-quarter of that is 786,432 rounded up to the next power of
two, which is 1,048,576. Each hash header is 40 bytes on HP-UX 11i v1 and 32 bytes on
HP-UX 11i v2, therefore, a 12-GB system would have 40 MB of memory allocated to the buffer cache
hash table on HP-UX 11i v1 and 32 MB on HP-UX 11i v2.
Buffer Cache Hash Locks
Instead of having a lock for each buffer cache hash header, a single lock is used for multiple hash
headers. This reduces the amount of memory needed for hash locks. Prior to HP-UX 11i v1 there were
128 hash locks. Therefore, the number of rows each hash lock covered increased as the size of the
buffer cache increased.
The following table specifies how many hash chains each hash lock covers. On HP-UX 11i v1 and
higher, the number of hash table rows covered by each lock is fixed at 8.
System Memory
Size
Hash Table Size
Hash Entries Per Lock
(HP-UX 11.0)
Hash Entries Per Lock
(HP-UX 11I v1,
HP-UX 11i v2)
Total Hash Table
Memory
1 GB 65536 512 8 2.5 MB
2 GB 131072 1024 8 5 MB
4 GB 262144 2048 8 10 MB
8 GB 524288 4096 8 20 MB
12 GB 1048576 8192 8 40 MB
32 GB 2097152 16384 8 80 MB
256 GB 16777216 131072 8 640 MB
Buffer Cache Address Map and Buffer Cache Virtual Map
In HPUX 11.00 and earlier, the buffer cache address map (there are actually two maps: bufmap and
bufmap2) is a resource map used to keep track of virtual addresses used by the buffer cache. The
bufmap contains entries for each address range that is free and available for use by the buffer
cache. The bufmap varies in size based on the memory size. It takes approximately 1 percent of
memory on a 32-bit system and 2 percent of memory on a 64-bit system.
The buffer cache virtual map (bcvmap) is a bitmap introduced with HP-UX 11i v1 that represents
pages in the buffer cache. Since it is a bitmap, its memory requirements are smaller than the bufmap.
By default, the bitmap is sized (in bits) to the number of physical memory pages multiplied by the
bcvmap_size_factor kernel tunable (the default is 2). There is some overhead to manage the
bitmap groups, but overall the memory usage is insignificant.
The default bcvmap_size_factor value of 2 is fine for many systems, especially those that use a
dbc_max_pct of 20 or less. However, when a dynamic buffer cache is used, buffers of varying
sizes can be allocated and deallocated over time. The allocation and deallocation of variable-sized
buffers can fragment the bcvmap. If there are not any bitmap areas available to represent the size of
the buffers needed, the system may thrash. This is more common with systems where dbc_max_pct
is configured at 50 percent or more or where different sized buffers are used. Buffers of different sizes
10