gtpm6m0mMain Supervisor Reference

Managing Storage

Main storage allocation for ECB-controlled programs is a dynamic process of getting and releasing virtual storage. All requests are processed through the storage management CSECT, CCSTOR.

There are two types of storage blocks: logical and physical. Logical blocks are carved from 4K frames. Common frames reside below 16MB and can be shared by application programs.

Application programs normally use logical block types, which include:

Block Type Use
128-byte block  
381-byte block Data records
Message blocks
1055-byte block Data records
Message blocks
4095-byte block Data records
Keypoint records
Program segments
Message blocks

The control program normally uses physical block types that include:

Block Type
Use

 Frames 
Working storage for ECBs (carved into 128-, 381-, 1055- and 4095-byte blocks).

 Common frames 
Working storage that can be shared between ECBs assigned for 128-, 381-, 1055- and 4095-byte blocks).

 ECB 
Entry control block.

 SWB 
System work block. SWBs are used as work blocks for the control program, for example, to contain multi-system request blocks used by the Multi-Processor Interconnect Facility (MPIF) feature. See the TPF Multi-Processor Interconnect Facility Reference.

 IOCB 
Input/output (control) block. Only DASD servicing routines use IOCBs.

In each ECB virtual memory is a one-megabyte area of private storage, below 16MB, known as the ECB private area. Application programs can issue macros (such as GETCC, RELCC, FINWC, FILEC and EXITC) to get and return storage blocks in this area. This virtual storage is carved from 4K frames of main storage.

ECBs can also get contiguous (or heap) storage in the heap private area area above 16MB. Application programs can issue the CALOC, MALOC, REALLOC and FREEC macros (or the calloc, malloc, realloc and free C functions) to get and release storage in this area.

ECBs share a pool of working storage below 16MB called the common area. Application programs use the GETCC macro (with the COMMON=YES parameter) to get common blocks in this area.

The control program uses the following macros to get and release storage:

The control program uses the $CONBC and $DISBC macros to connect and disconnect blocks to and from an ECB virtual memory.

The working storage blocks for ECBs are allocated by CTIN and assigned by the OPZERO program and returned to the ECB pool by the EXIT routine (see Initializing ECBs via OPZERO and Returning ECBs after Entries Are Processed).

IOCBs and SWBs are for the exclusive use of the control program and reside in protected storage. All other blocks reside in unprotected storage.

In an online system, you can display the number of available main storage blocks with the ZSTAT command.

Block Checking Mode

Block checking mode is a debugging tool that flags certain coding errors, such as writing beyond the end of a block, passing blocks chained to other blocks, and using storage that has already been released. When block checking mode is on:

You can turn block checking mode on and off with the ZSTRC command, without re-IPLing.

Note:
Block checking mode should be used with caution in a production system, since it degrades CPU performance and depletes working storage.