Reducing storage stress
Storage stress occurs when there is a shortage of free space in one of the dynamic storage areas.
- Other resource constraints that cause CICS® tasks to occupy storage for longer than usual
- A sudden large number of tasks that overwhelm available free storage
- Badly designed applications that require unreasonably large amounts of storage
- With decreasing free storage availability, nonresident, not-in-use programs might be deleted progressively, as CICS determines appropriate, on a least-recently-used basis. Dispatch of new tasks is also progressively slowed as free storage approaches a critically small amount. This self-tuned activity tends to spread the cost of managing storage. There might be more program loading overall, but the heavy overhead of a full program compression is not incurred at the critical time.
- The loading or reloading of programs is handled by CICS with an MVS™ subtask. In this way, other user tasks can proceed if a processor of the MVS image is available and even if a page-in is required as part of the program load.
- User runtime control of storage usage is achieved through appropriate use of maximum task specification (MXT) and transaction class limits. This is necessary to avoid the short-on-storage condition that can result from unconstrained demand for storage.
Short-on-storage condition
CICS reserves a minimum number of free storage pages for use only when there is not enough free storage to satisfy an unconditional GETMAIN request even after all not-in-use nonresident programs have been deleted.
Whenever a request for storage results in the number of contiguous free pages in one of the dynamic storage areas falling below its respective cushion size, or failing to be satisfied even with the storage cushion, a cushion stress condition exists. Details are given in the storage manager statistics ("Times request suspended", "Times cushion released"). CICS attempts to alleviate the storage stress situation by taking a number of actions. If these actions fail to alleviate the situation, or if the stress condition is caused by a task that is suspended for SOS, a short-on-storage condition is signaled. This is accompanied by message DFHSM0131, DFHSM0133 or DFHSMSM0606.
- Removing unwanted data set name blocks
- The extended CICS dynamic
storage area (ECDSA) is also used for data set name (DSN) blocks.
One DSN block is created for every data set that CICS file control opens, and they are recovered
at a warm or emergency restart. If an application creates a large
number of temporary data sets, all with a unique name, the number
of DSN blocks can increase to such an extent that they can cause a
short-on-storage condition.
If application programs use temporary data sets, with a different name for every data set created, it is important that these programs remove the temporary data sets after use. See SET DSNAME for information about how you can use this command to remove unwanted temporary data sets from your CICS regions.
- Language Environment® runtime options for AMODE(24) programs
- Two of the default Language Environment runtime options for CICS are ALL31(ON) and STACK(ANY). This means all programs that require Language Environment must be capable of addressing 31-bit storage, that is, must be AMODE(31) when Language Environment is enabled. For AMODE(24) programs to run in a Language Environment environment, you can specify ALL31(OFF) and STACK(BELOW). However, if you change these options globally so that all programs can use them, a lot of storage will be put below the 16 MB line, which might cause a short-on-storage condition.
For more information, see Short-on-storage conditions in dynamic storage areas.
Purging tasks
If a CICS task is suspended for longer than its DTIMOUT value, it might be purged if SPURGE=YES is specified on the RDO transaction definition. That is, the task is abended and its resources freed, thus allowing other tasks to use those resources. In this way, CICS attempts to resolve what is effectively a deadlock on storage.
If purging tasks is not possible or does not solve the problem, CICS stops processing. You must then cancel and restart the CICS region.