IBM Power7 Optimization And Tuning Manual page 85

Table of Contents

Advertisement

Malloc 3.1 allocator
This allocator is selected when MALLOCTYPE=3.1 is set. This is a bucket allocator that
divides the heap into 28 hash buckets, each with a size of 2 pow (x+4), where x stands for
bucket index. This allocator provides the best performance at the cost of memory. In most
cases, this algorithm can use as much as twice the amount of memory that is actually
requested by the application. In addition, an extra page is required for buckets larger than
4096 bytes because objects of a page in size or larger are page-aligned. Interestingly,
some earlier customer applications still use this allocator, as it is more tolerant for
application memory overwrite bugs.
Memory allocator suboptions
There are many suboptions available that can be selected by exporting the MALLOCOPTIONS
environment variable. This chapter covers a few of the suboptions that are more relevant to
performance tuning. For a complete list of options, see System Memory Allocation Using the
malloc Subsystem, available at:
http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.genprogc/doc/genprogc
/sys_mem_alloc.htm
Multiheap
By default, the malloc subsystem uses a single heap, which causes lock contention for
internal locks that are used by malloc in case of multi-threaded applications. By enabling
this option, you can configure the number of parallel heaps to be used by allocators. You
can set the multiheap by exporting MALLOCOPTIONS=multipheap[:n], where n can vary
between 1- 32 and 32 is the default if n is not specified.
Use this option for multi-threaded applications, as it can improve performance.
Buckets
This suboption is similar to the built-in bucket allocator of the Watson allocator. However,
with this option, you can have fine-grained control over the number of buckets, number of
blocks per bucket, and the size of each bucket. This option also provides a way to view the
usage statistics of each bucket, which be used to refine the bucket settings.
In case the application has many requests of the same size, then the bucket allocator can
be configured to preallocate the required size by correctly specifying the bucket options.
The block size can go beyond 512 bytes, compared to the Watson allocator or malloc
pool options.
You can enable the buckets allocator by exporting MALLOCOPTIONS=buckets. Complete
details about the buckets options for fine-grained control are available
buckets allocator turns off the built-in bucket component if the Watson allocator is used.
malloc pools
This option enables a high performance front end to malloc subsystem for managing
storage objects smaller than 513 bytes. This suboption is similar to the built-in bucket
allocator of the Watson allocator. However, this suboptions maintains the bucket for each
thread, providing lock-free allocation and deallocation for blocks smaller than 513 bytes.
This suboption improves the performance for multi-threaded applications, as the time
spent on locking is avoided for blocks smaller than 513 bytes.
The pool option makes small memory block allocations fast (no locking) and memory
efficient (no header on each allocation object). The pool malloc both speeds up single
threaded applications and improves the scalability of multi-threaded applications.
1
System Memory Allocation Using the malloc Subsystem, available at:
http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix.genprogc/doc/genprogc/sys_mem_alloc.htm
1
. Enabling the
69
Chapter 4. AIX

Advertisement

Table of Contents
loading

This manual is also suitable for:

Power7+

Table of Contents