Controlling storage allocation

The following runtime options control storage allocation:

z/OS Language Environment Programming Guide provides useful tips to assist with the tuning process. Appropriate tuning is necessary to avoid performance problems.

To generate a report of the storage a routine (or more specifically, an enclave) used during its run, specify the RPTSTG(ON) runtime option. The storage report, generated during enclave termination provides statistics that can help you understand how space is being consumed as the enclave runs. If storage management tuning is desired, the statistics can help you set the corresponding storage-related runtime options for future runs. The output is written to the Language Environment message file.

Neither the storage report nor the corresponding runtime options include the storage that Language Environment acquires during early initialization, before runtime options processing, and before the start of space management monitoring. In addition, Language Environment® does not report alternative Vendor Heap Manager activity.

Figure 1 and Figure 3 are examples of storage reports that are produced when RPTSTG(ON) is specified. The sections that follow these reports describe the contents of the reports.

Figure 1. Storage report produced by run-time option RPTSTG(ON)
 Start of changeStorage Report for Enclave main 09/17/12 03:31:45 PM
 Language Environment V02 R01.00End of change

     STACK statistics:
       Initial size:                                         4096
       Increment size:                                       4096
       Maximum used by all concurrent threads:               7488
       Largest used by any thread:                           7488
       Number of segments allocated:                            2
       Number of segments freed:                                0
     THREADSTACK statistics:
       Initial size:                                         4096
       Increment size:                                       4096
       Maximum used by all concurrent threads:               3352
       Largest used by any thread:                           3352
       Number of segments allocated:                            6
       Number of segments freed:                                0
     LIBSTACK statistics:
       Initial size:                                         4096
       Increment size:                                       4096
       Maximum used by all concurrent threads:                  0
       Largest used by any thread:                              0
       Number of segments allocated:                            0
       Number of segments freed:                                0
     THREADHEAP statistics:
       Initial size:                                         4096
       Increment size:                                       4096
       Maximum used by all concurrent threads:                  0
       Largest used by any thread:                              0
       Successful Get Heap requests:                            0
       Successful Free Heap requests:                           0
       Number of segments allocated:                            0
       Number of segments freed:                                0
   
Figure 2. Storage report produced by run-time option RPTSTG(ON) (continued)
  HEAP statistics:
       Initial size:                                        49152
       Increment size:                                      16384
       Total heap storage used (sugg. initial size):        29112
       Successful Get Heap requests:                          251
       Successful Free Heap requests:                         218
       Number of segments allocated:                            1
       Number of segments freed:                                0
     HEAP24 statistics:
       Initial size:                                         8192
       Increment size:                                       4096
       Total heap storage used (sugg. initial size):            0
       Successful Get Heap requests:                            0
       Successful Free Heap requests:                           0
       Number of segments allocated:                            0
       Number of segments freed:                                0
     ANYHEAP statistics:
       Initial size:                                        32768
       Increment size:                                      16384
       Total heap storage used (sugg. initial size):       104696
       Successful Get Heap requests:                           28
       Successful Free Heap requests:                          15
       Number of segments allocated:                            6
       Number of segments freed:                                5
     BELOWHEAP statistics:
       Initial size:                                         8192
       Increment size:                                       8192
       Total heap storage used (sugg. initial size):            0
       Successful Get Heap requests:                            0
       Successful Free Heap requests:                           0
       Number of segments allocated:                            0
       Number of segments freed:                                0
     Additional Heap statistics:
       Successful Create Heap requests:                         1
       Successful Discard Heap requests:                        1
       Total heap storage used:                              4912
       Successful Get Heap requests:                            3
       Successful Free Heap requests:                           3
       Number of segments allocated:                            2
       Number of segments freed:                                2
     Largest number of threads concurrently active:             2
 End of Storage Report

Figure 3 shows an example of a storage report that is produced with XPLINK

Figure 3. Storage report produced by RPTSTG(ON) with XPLINK
 Start of changeStorage Report for Enclave main 09/17/12 03:31:45 PM
 Language Environment V02 R01.00End of change                        
                                                                                                   
    STACK statistics:                                                                              
      Initial size:                                       131072                                   
      Increment size:                                     131072                                   
      Maximum used by all concurrent threads:               5416                                   
      Largest used by any thread:                           5416                                   
      Number of segments allocated:                            1                                   
      Number of segments freed:                                0                                                                    
    THREADSTACK statistics:                                                                                                         
      Initial size:                                         4096                                                                    
      Increment size:                                       4096                                                                    
      Maximum used by all concurrent threads:              45536                                                                    
      Largest used by any thread:                           6552                                                                    
      Number of segments allocated:                           60                                                                    
      Number of segments freed:                                0                                                                    
    XPLINK STACK statistics:                                                                                                        
      Initial size:                                       524288                                                                    
      Increment size:                                     131072                                                                    
      Largest used by any thread:                          20400                                                                    
      Number of segments allocated:                            1                                                                    
      Number of segments freed:                                0                                                                    
    XPLINK THREADSTACK statistics:                                                                                                  
      Initial size:                                       131072                                                                    
      Increment size:                                     131072                                                                    
      Largest used by any thread:                          22160                                                                    
      Number of segments allocated:                           30                                                                   
      Number of segments freed:                                0   
    LIBSTACK statistics:                                                                                                            
      Initial size:                                         4096                                                                    
      Increment size:                                       4096                                                                    
      Maximum used by all concurrent threads:                  0                                                                    
      Largest used by any thread:                              0                                                                    
      Number of segments allocated:                            0                                                                    
      Number of segments freed:                                0                                                                    
    THREADHEAP statistics:                                                                                                          
      Initial size:                                         4096                                                                    
      Increment size:                                       4096                                                                    
      Maximum used by all concurrent threads:                  0                                                                    
      Largest used by any thread:                              0                                                                    
      Successful Get Heap requests:                            0                                                                    
      Successful Free Heap requests:                           0                                                                    
      Number of segments allocated:                            0                                                                    
      Number of segments freed:                                0                                                                    
    HEAP statistics:                                                                                                                
      Initial size:                                        32768                                                                    
      Increment size:                                      32768                                                                    
      Total heap storage used (sugg. initial size):       286576                                                                    
      Successful Get Heap requests:                           71                                                                    
      Successful Free Heap requests:                           1                                                                    
      Number of segments allocated:                           10                                                                    
      Number of segments freed:                                0                                                                    
Figure 4. Storage report produced by RPTSTG(ON) with XPLINK (continued)
    HEAP24 statistics:                                                                                                              
      Initial size:                                         8192                                                                    
      Increment size:                                       4096                                                                    
      Total heap storage used (sugg. initial size):            0                                                                    
      Successful Get Heap requests:                            0                                                                    
      Successful Free Heap requests:                           0                                                                    
      Number of segments allocated:                            0                                        
      Number of segments freed:                                0
    ANYHEAP statistics:                                                                                                             
      Initial size:                                        16384                                                                    
      Increment size:                                       8192                                                                    
      Total heap storage used (sugg. initial size):      1139712                                                                    
      Successful Get Heap requests:                          487                                                                    
      Successful Free Heap requests:                         431                                                                    
      Number of segments allocated:                           50                                                                    
      Number of segments freed:                               36                                                                    
    BELOWHEAP statistics:                                                                                                           
      Initial size:                                         8192                                                                    
      Increment size:                                       4096                                                                    
      Total heap storage used (sugg. initial size):            0                                                                    
      Successful Get Heap requests:                            0                                                                    
      Successful Free Heap requests:                           0                                                                    
      Number of segments allocated:                            0                                                                    
      Number of segments freed:                                0                                                                    
    Additional Heap statistics:                                                                                                     
      Successful Create Heap requests:                         0                                                                    
      Successful Discard Heap requests:                        0                                                                    
      Total heap storage used:                                 0                                                                    
      Successful Get Heap requests:                            0                                                                    
      Successful Free Heap requests:                           0                                                                    
      Number of segments allocated:                            0                                                                    
      Number of segments freed:                                0                                                                    
    HEAPPOOLS Statistics:                                                                                                           
      Pool  1     size:     8 Get Requests:           3                                                                             
        Successful Get Heap requests:     1-    8                3                                                                  
      Pool  2     size:    32 Get Requests:         268                                                                             
        Successful Get Heap requests:     9-   16               36                                                                  
        Successful Get Heap requests:    17-   24                3                                                                  
        Successful Get Heap requests:    25-   32              229                                                                  
      Pool  3     size:   128 Get Requests:         186                                                                             
        Successful Get Heap requests:    33-   40                3                                                                  
        Successful Get Heap requests:    41-   48                8                                                                  
        Successful Get Heap requests:    49-   56              111                                                                  
        Successful Get Heap requests:    57-   64                4                                                                  
        Successful Get Heap requests:    65-   72                2                                                                  
        Successful Get Heap requests:    73-   80                4                                                                  
        Successful Get Heap requests:    81-   88                6                                                                  
        Successful Get Heap requests:    89-   96                2                                                                  
        Successful Get Heap requests:    97-  104                1                                                                  
        Successful Get Heap requests:   105-  112                5                                                                  
        Successful Get Heap requests:   113-  120               31                                                                  
        Successful Get Heap requests:   121-  128                9
Figure 5. Storage report produced by RPTSTG(ON) with XPLINK (continued)
     Pool  4     size:   256 Get Requests:          38                                                                             
        Successful Get Heap requests:   137-  144                2                                                                  
        Successful Get Heap requests:   145-  152                2                                                                  
        Successful Get Heap requests:   153-  160                2                                                                  
        Successful Get Heap requests:   161-  168                1                                                                  
        Successful Get Heap requests:   169-  176                4                                                                  
        Successful Get Heap requests:   177-  184                4                                                                  
        Successful Get Heap requests:   185-  192                2                                                                  
        Successful Get Heap requests:   193-  200                2                                                                  
        Successful Get Heap requests:   201-  208                3                                                                  
        Successful Get Heap requests:   209-  216                2                                                                  
        Successful Get Heap requests:   217-  224                3                                                                  
        Successful Get Heap requests:   225-  232                3                                                                  
        Successful Get Heap requests:   233-  240                1                                                                  
        Successful Get Heap requests:   241-  248                3                                                                  
        Successful Get Heap requests:   249-  256                4                                                                  
      Pool  5.1   size:  1024 Get Requests:         230                                                                             
      Pool  5.2   size:  1024 Get Requests:           3                                                                             
      Pool  5.3   size:  1024 Get Requests:           5                                                                             
        Successful Get Heap requests:   257-  264              225                                                                  
        Successful Get Heap requests:   273-  280                2                                                                  
        Successful Get Heap requests:   281-  288               10                                                                  
        Successful Get Heap requests:   841-  848                1                                                                  
      Pool  6     size:  2048 Get Requests:           2                                                                             
        Successful Get Heap requests:  1113- 1120                1                                                                  
        Successful Get Heap requests:  1137- 1144                1                                                                  
      Requests greater than the largest cell size:             2                                                                    
    HEAPPOOLS Summary:                                                                                                              
      Specified Element   Extent   Cells Per  Extents    Maximum      Cells In                                                      
      Cell Size Size      Percent  Extent     Allocated  Cells Used   Use                                                           
      ------------------------------------------------------------------------                                                      
            8        16     10         204           1           1           0                                                      
           32        40     10          81           3         226         225                                                      
          128       136     10          24           4          88          77                                                      
          256       264     10          12           1           1           0                                                      
         1024      1032     10           4          57         228         227                                                      
         1024      1032     10           4           1           2           0                                                      
         1024      1032     10           4           1           3           0                                                      
         2048      2056     10           4           1           2           2                                                      
      ------------------------------------------------------------------------                                                      
      Suggested Percentages for current Cell Sizes:                                                                                 
        HEAPP(ON,8,1,32,28,128,37,256,1,(1024,3),90,2048,13,0)                                                                      
      Suggested Cell Sizes:                                                                                                         
        HEAPP(ON,                                                                                                                   
              32,,56,,88,,120,,128,,168,,                                                                                           
              208,,248,,288,,848,,1144,,2080,)                                                                                      
    Largest number of threads concurrently active:            11                                                                    
End of Storage Report                                                                                                               
    
The statistics for initial and incremental allocations of storage types that have a corresponding runtime option differ from the runtime option settings when their values have been rounded up by the implementation, or when allocations larger than the amounts specified were required during execution. All of the following are rounded up to an integral number of double-words:

The runtime options should be tuned appropriately to avoid performance problems. See z/OS Language Environment Programming Guide for tips on tuning.