Difference between revisions of "OcsFastHeap"
m |
m |
||
Line 25: | Line 25: | ||
export MALLOCTYPE=user:ocs_fast_heap.a | export MALLOCTYPE=user:ocs_fast_heap.a | ||
− | The OCS Fast Heap will be used by all programs | + | The OCS Fast Heap will be used by all programs started the shell, and all programs started by those programs. |
== Options == | == Options == |
Revision as of 20:54, 4 September 2020
OCS Fast Heap
The OCS Fast Heap is a user-defined malloc replacement for AIX (see: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/generalprogramming/malloc_replace.html).
The OCS Fast Heap is designed to prioritize fast performance over more memory usage. The heap can be configured to match the exact heap profile (block size and count) required by an application for maximum performance, but also will automatically expand to meet demand (using sbrk()).
The OCS Fast Heap achieves its performance gains by using pools of fixed-size blocks. User requests are completed using the closest sized block. Blocks are never merged into larger blocks, so fragmentation is possible, but proper analysis (using hmp.ual) can avoid potential problems by determining program stated-state and peak needs.
Packaging
The OCS Fast Heap is delivered in an archive containing 32-bit and 64-bit version object files. The archive is located
in $POWERADA/lib/ocs_fast_heap.a
. You can check the version of the archive using the strings
command:
strings ocs_fast_heap.a | grep ocs_fast_heap ocs_fast_heap.c 00.00.26 200901-17;20
Activation
The OCS Fast Heap can be activated by setting:
export LIBPATH=:/path/to/ocs_fast_heap.a export MALLOCTYPE=user:ocs_fast_heap.a
The OCS Fast Heap will be used by all programs started the shell, and all programs started by those programs.
Options
OCS Fast Heap options can be specified with:
export MALLOCOPTIONS=[<option>[,<option> ...]]
where <option> is:
counts - keep usage counts. dontfailonce - don't fail once before using large-sized blocks; use larger blocks as soon as small block can't be created anymore. stats - produce stats in default file in CWD. stats:/path/to/file%d.txt - produce stats to named file. (%d=PID) pools:<pool-spec>[!<pool-spec] ...] - specify pool block sizes and pre-allocated counts where <pool-spec> is "<sizeInBytes>.<count>". All pools must be specified in increasing size. Pool block counts will increase as needed. A maximum of 40 pools can be specified.
The default pool size/count specification is:
32.2000000!64.500000!128.25000!256.10!512.10!1024.10!2048.10!4096.10!8192.0!16384.0!32768.0!65536.0!131072.0!65536.0!131072.0!262144.0!524288.0!1060000.0!16900000.0!33560000.0!50332000.0!67120000.0!73400000.0!83890000.0
Note that maximum pool size is limited by sbrk()
to INT32_MAX
or INT64_MAX
. This is half of the maximum value of size-t
.
Debug options can be specified with:
export MALLOCDEBUG=<option>[,<option> ...]
where <option> is
debug - produce debug in default file in CWD debug:/path/to/file%d.txt - produce debug to named file. (%d = PID) abortdf - abort on double free abortua - abort on free of unknown address abortba - abort on free of bad (unaligned) address
The heap in core files can be debugged by referencing the ocs_fast_heap.h
include file. This file describes some structures used by the OCS Fast Heap and some tags used to mark the data in memory.