Storage - 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) option 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 run-time options. For PL/I multitasking applications, the Language Environment THREADHEAP run-time option can be used to tune heap storage at the task level.

The heap pools algorithm 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, it 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 run-time options HEAPPOOL(ON) using the default cell sizes and percentages) and RPTSTG(ON) for some time with a representative application workload. Then examine the "HEAPPOOLS Statistics" and "HEAPPOOLS Summary" sections of the "Storage Report for Enclave" report.
  2. Change the cell sizes in the HEAPPOOLS run-time 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" should be the optimal values to minimize storage use.

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

You can tune stack storage by using the Language Environment STACK and THREADSTACK run-time options. RPTSTG(ON) can have a negative affect on the performance of your application, because as the application runs, statistics are kept on storage requests. Therefore, always use the IBM-supplied default setting RPTSTG(OFF) when running production jobs. Use RPTSTG(ON) only when debugging or tuning applications.