Tuning heap storage

For best performance, the initial heap segment should be large enough to satisfy all requests for heap storage. The Language Environment storage report generated by the RPTSTG(ON) runtime option (see z/OS Language Environment Programming Reference) shows you how much heap storage is being used, the total number of segments allocated to the heap, the statistics for the optional heap pools algorithm, and the recommended values for the HEAP, ANYHEAP, BELOWHEAP and HEAPPOOLS runtime options. For PL/I multitasking applications, the Language Environment THREADHEAP runtime option can be used to tune heap storage at the task level.

The heap pools algorithm (see Using HEAPPOOLS to improve performance) can be used to significantly increase the performance of heap storage allocation, especially in a multi-threaded application that experiences contention for heap storage. However, if the algorithm is not properly tuned, heap storage could be used inefficiently.

Tuning the heap pools algorithm for an application is a three-step process:

  1. Run your application with the runtime options HEAPPOOLS(ON) or HEAPPOOLS(ALIGN) as appropriate using the following cell sizes and percentages:
    (8,10,32,10,128,10,256,10,1024,10,2048,10,3072,1,4096,1,
    8192,1,16384,1,32768,1,65536,1)
    and RPTSTG(ON) for some time with a representative application workload. It may be necessary for the application to increase the region size.
  2. Change the cell sizes in the HEAPPOOLS runtime option to the "Suggested Cell Sizes" from the first run. Re-run the application with a representative workload, using the default percentages in the HEAPPOOLS option. Examine the storage report.
  3. The values listed as "Suggested Percentages for Current Cell Sizes" are the recommended values to minimize storage usage. These values should be evaluated prior to finalizing cell pool sizes.

Any time there is a significant change in the workload, repeat these tuning steps to obtain optimal HEAPPOOLS values.

RPTSTG(ON) and the STORAGE runtime option (see z/OS Language Environment Programming Reference) can have a negative affect on the performance of your application. Therefore, always use the IBM-supplied default setting RPTSTG(OFF) when running production jobs. Use RPTSTG(ON) and STORAGE(xx,xx,xx) only to debug applications.

Usage notes:
  1. These recommendations are dynamic and represent values for this particular run. The values might change with each run performed.
  2. Long-running applications might have an adverse effect on the statistical data collection. Fixed length counters might overflow, causing incorrect HEAPPOOLS recommendations. If the recommendations appear to be unrealistic, rerun with a reduced application run time.