Use of program cache

Caching a program improves performance because reloading costs are saved when the program is used. The following options affect program caching:

  • The Region Definitions (RD) ProgramCacheSize attribute.

    Programs in all languages except Java™ and Micro Focus COBOL are cached only if, at the time a program is loaded, the Program Definitions (PD) Resident attribute is set to yes and the number of cached programs in use has not reached the maximum number.

    A resident program is not loaded again until one of the following occurs:

    • A SET PROGRAM NEWCOPY or SET PROGRAM COPY(NEWCOPY) or SET PROGRAM PHASEIN or SET PROGRAM COPY(PHASEIN) command is issued.
      Note: On Windows systems, a file that is on disk cannot be removed or overwritten while a copy of it is in the cache. Therefore, new copies of programs on Windows can be used only if they are not cached.
    • The value of the Resident attribute is changed to no.
    • The cache is full and the program is removed to make room for a new entry. In this case, the least-recently used program is removed, leaving more-frequently used programs in the cache.

    Because individual programs in use are not removed from the cache, it is recommended that the cache size allow programs at every logical level to be cached when EXEC CICS® LINK is used.

  • The environment variable COBSW is set to lnn.

    where nn is the cache size in bytes. This is a Micro Focus COBOL environment variable that sets the length of the Micro Focus COBOL program cache. This variable is defined in the region's environment file.

  • The environment variable DYNAMIC_MEMORY_LIMIT is set to nn.

Java programs can be cached by the Java runtime controlled through the Java Virtual Machine (JVM).

Programs are loaded into the cache in the sequence in which they are accessed.

Note:
  • Programs are cached for each application server, so a new copy of the program has no effect on an application server if the application server has not yet run the program.
  • The SET PROGRAM NEWCOPY or SET PROGRAM COPY (NEWCOPY) or SET PROGRAM PHASEIN or SET PROGRAM COPY (PHASEIN) commands for a Micro Focus COBOL program removes every program that was previously loaded by the application server, so that a fresh copy of every such program is used after one of these commands is run, not only the program for which the SET PROGRAM NEWCOPY or SET PROGRAM COPY (NEWCOPY) or SET PROGRAM PHASEIN or SET PROGRAM COPY (PHASEIN) command is issued. These commands have no effect on Java programs.