As explained in Java™ Applications in CICS®, a JVM in CICS runs as a UNIX System Services process in a Language Environment® enclave created using the Language Environment preinitialization module, CEEPIPI, and it uses MVS™ Language Environment services rather than CICS Language Environment services. As a result, all storage obtained by the JVM is MVS storage, obtained by calls to MVS Language Environment services. This storage resides within the CICS address space but is not included in the CICS dynamic storage areas (DSAs).
Each JVM executes within its own Language Environment enclave, using storage allocations set by CICS. Java Applications in CICS explains how the storage heaps in the JVM are allocated from the Language Environment enclave heap storage.
The Language Environment enclave for each JVM needs to contain not only the storage heaps described in Tuning storage for individual JVMs, but also a basic amount of storage for each JVM. This basic storage cost represents the amount of storage in the Language Environment enclave that is used for the structure of the JVM, and when you calculate the total size of the JVM, the basic storage cost must be added to the storage that is used for the storage heaps.
The basic Language Environment run-time options used by CICS for a JVM enclave are shown in Table 13:
Language Environment run-time options | Value set by CICS |
---|---|
Library heap storage that is not restricted to a location below 16MB. |
|
Library heap storage that must be located below 16MB. |
|
Storage for user-controlled dynamically allocated variables. |
|
Library stack storage |
|
![]() ![]() |
![]()
![]() |
Amount of storage reserved for the out-of-storage condition and the initial content of storage when allocated and freed. |
|
You can override the Language Environment run-time options using the DFHJVMRO user-replaceable module, which is described in the CICS Customization Guide. The default Language Environment storage settings that control the initial size of, and incremental additions to, the Language Environment enclave heap storage can make inefficient use of MVS storage. The storage settings that CICS supplies in DFHJVMRO are more efficient. You can also modify these settings to match more closely with the storage use of your JVMs. To improve the use of MVS storage, you are recommended to use DFHJVMRO to set the initial allocation for the amount of Language Environment enclave heap storage to a value that approximates to the storage actually used by your Java applications that run in JVMs, using this as an initial heap size. Note that the settings that you make using DFHJVMRO apply to all the JVMs in your CICS region (with the exception of the master JVM that initializes the shared class cache), so you should consider the different storage heap sizes and basic storage costs that JVMs with different profiles might have. As noted in Managing your JVM pool for performance, the basic storage cost for a standalone JVM is significantly larger than the basic storage cost for a worker JVM.
You can use the CICS statistics to see how much Language Environment enclave heap storage is used by your JVMs. The field "Peak Language Environment heap storage used" in the JVM Profile statistics shows the peak (or high water mark) amount of Language Environment enclave heap storage that was actually used by a JVM with the specified execution key and profile. Collecting this statistic affects the performance of JVMs, so you should not carry out this process in a production environment. To obtain this information:
An alternative method of identifying a suitable value for the initial allocation for the amount of Language Environment enclave heap storage, is to use the RPTO(ON) and RPTS(ON) options in DFHJVMRO to obtain storage reports. These options increase CPU costs, so they should not be used in a production environment. DFHJVMRO cannot identify the JVM profile to which each storage report applies, so you should use this procedure for only one JVM profile at a time, by making sure you are using transactions that request only that JVM profile.
To obtain storage reports for your JVMs:
For example, if you receive the following storage report:
HEAP statistics:
Initial size: 31457280
Increment size: 2097152
Total heap storage used (sugg, initial size): 38837096
Successful Get Heap requests: 155034
Successful Free Heap requests: 108642
Number of segments allocated: 7
Number of segments freed: 0
you can set these values for Language Environment enclave heap storage, using DFHJVMRO:
HEAP(38M,1M,ANYWHERE,FREE,0K,4080)
The amounts of storage required for a JVM in a Language Environment enclave may require changes to installation exits, IEALIMIT or IEFUSI, which you use to limit the region size. Note that running with a default IEFUSI and specifying REGION=0M will result in a region size of 32M, which is not enough to support a JVM.
A possible approach is to have a JVM owning region (JOR), to which all JVM program executions are routed. Such a region would run only JVM workloads, thereby allowing you to minimize the amount of CICS DSA storage required, and allow the maximum amount of MVS storage to be allocated for use by JVMs.