HEAPPOOLS64 (AMODE 64 only)

Derivation: HEAP storage POOLS for AMODE 64

The HEAPPOOLS64 runtime option is used to control an optional user heap storage management algorithm, known as heap pools. This algorithm is designed to improve the performance of multithreaded C/C++ applications with a high frequency of calls to malloc(), calloc(), realloc(), free(), and operators new and delete. When active, heap pools virtually eliminates contention for user heap storage.

AMODE 64 default
HEAPPOOLS64=((OFF,8,4000,32,2000,128,700,256,350, 1024,100,2048,50,3072,50,4096,50,8192,25,16384,10,32768,5,65536,5),OVR)

1  HEAPPOOLS64 = ( (
1! OFF
1 ON
1 ALIGN
2  ,
2 + ,(1)
3.1 cell-size
3.1?  ( cell-size , pool-count )
2 ,
2 count
2  )
2  ,
1! OVR
1 NONOVR
3  )
Notes:
  • 1 repeats 11 times
OFF
Specifies that the AMODE 64 heappools algorithm is not used. OFF is the default.
ON
Specifies that the AMODE 64 heappools algorithm is used.
ALIGN
Specifies that Language Environment® structures the storage for cells in a heap pool so that a cell less than or equal to 240 bytes does not cross a cache line. For cells larger than 240 bytes, two cells never share a cache line.
cell-size
Specifies the size of the cells in a heap pool, which is specified as n or nK. The cell size must be a multiple of 8, with a maximum of 65536 (64 K).
pool-count
The number of pools to create for the cell size. The pool-count must be in a range from 1 to 255.
count
Specifies the number of cells of the corresponding size to be allocated initially. The minimum cell count is 4.
OVR
Specifies that the option can be overridden. OVR is the default.
NONOVR
Specifies that the option cannot be overridden.

Usage notes

  • HEAPPOOLS64 only manages storage above the 2-G bar.
  • Cell pool sizes should be specified in ascending order.
  • To use less than twelve heap pools, specify 0 for the cell size after the last heap pool to be used. For example, if four heap pools are desired, use 0 for the fifth cell size when setting the HEAPPOOLS64 runtime option.
  • Each heap pool is allocated as needed. The allocation of a heap pool can result in the allocation of a heap increment to satisfy the request.
  • Using the ALIGN suboption might cause an increase in the amount of heap storage used by an application.
  • Examine the storage report and adjust storage tuning when first using the ALIGN suboption.
  • The HEAPCHK runtime option does not validate individual heap pool cells.
  • If you specify the RPTSTG runtime option while using HEAPPOOLS64, extra storage is obtained from the LIBHEAP64 and is used to complete the storage report on heappools. This extra storage is only allocated when both HEAPPOOLS64 and RPTSTG are used.
  • When cell-size is specified without parenthesis, the default value of pool-count is 1 rather than being picked up from an earlier setting of pool-count. For example, specifying 128 is treated like (128,1).
  • When cell-size is specified within parenthesis, pool-count must also be specified.
  • When pool-count is greater than 1, the size of each heap pool extent is determined by dividing the heap allocation for the cell-size by the pool-count.
  • HEAPPOOLS runtime option can be used by AMODE 64 applications to manage user heap storage above the 16-MB line and below the 2-GB bar.

Performance considerations

  • To improve the effectiveness of the heap pools algorithm, use the storage report numbers that are generated by the RPTSTG runtime option as an aid in determining optimum cell sizes, cell count, and the initial heap size.
  • Use caution when using cells larger than 2 K. Large gaps between cell sizes can lead to a considerable amount of storage waste. Properly tuning cell sizes with the help of RPTSTG is necessary to control the amount of virtual storage that is needed by the application.
  • When there are many successful get requests for the same size cell and the maximum elements used in the cell pool is high, this can be an indication that there is excessive contention allocating elements in the cell pool. Specifying pool-count greater than 1 might help relieve some of this contention. Multiple pools are allocated with the same cell size and a portion of the threads are assigned to allocate cells out of each of the pools.

Examples

Specifying HEAPPOOLS64(ON,(8,4),1000,(16,2),500) results in:
  • Four cell pools being allocated for 8-byte cells with each pool extent containing 250 cells.
  • Two cell pools being allocated for 16-byte cells with each pool containing 250 cells.