Optimizing memory and storage

Memory allocations can significantly affect the performance of your application. You can optimize your runtime space requirements by using the following Language Environment runtime options:
ANYHEAP BELOWHEAP HEAP HEAPPOOLS
LIBSTACK STACK STORAGE THREADSTACK
HEAP64 HEAPPOOLS64 STACK64 THREADSTACK64
Stack extensions can also cause significant performance hits. For this reason:

The RPTSTG(ON) option should not be used in the final build or run because it is resource-intensive, which adversely affects the performance of the application. The __heaprpt() function, which does not require the RPTSTG(ON) option, obtains a summary heap storage report while your application is running. For more information, see __heaprpt() in z/OS XL C/C++ Runtime Library Reference.

You can also tune I/O storage by using the _EDC_STOR_INITIAL and _EDC_STOR_INCREMENT environment variables. The I/O storage usage is not in the storage report.

For more information about runtime storage, see Stack and heap storage in z/OS Language Environment Programming Guide