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 STACK/STACK64 specified should be large enough
to ensure that a stack extension never occurs during the execution
of the program.
- The HEAP/HEAP64 should be large enough for an
average application execution run, and the increment size should be
a reasonable portion of the difference between the typical heap used
and the maximum amount of heap that may be used.
- Use the RPTSTG(ON) Language Environment runtime
option or the __heaprpt() function to determine the
storage usage and the option settings for the given run of your application.
The generated report will show if the ANYHEAP, BELOWHEAP, LIBSTACK,
and THREADSTACK/THREADSTACK64 are set to the recommended
values. The STACK/STACK64 and HEAP/HEAP64 defaults
should be as specified above.
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