The system generally causes processes to share the same code segment dictionary if the processes are executions of the same program. This technique reduces total memory usage and thus reduces the system overhead for memory management. The result is that all the processes in the mix are able to run more quickly.
There are a few situations in which the system does not use the same code segment dictionary for processes that are executing the same program. Understanding these situations can help you to conserve memory and control process privileges.
To decide whether two processes are executions of the same program, the system compares the object code file title for each process. Suppose you have one copy of OBJECT/PROG on the family SYSPK, and another copy on a family called DOCPK. In this case, the family part of the object code file title is different. The system therefore regards these as two different programs. If people are using both programs simultaneously, the system has to create two separate code segment dictionaries. You can eliminate this duplication, and thus reduce system overhead, by placing a single object code file in a central location where all the users have access to it.
Even if two processes have the same object code file title, the system still assigns them different code segment dictionaries in the following cases:
-
If either of the processes is running in Test and Debug System (TADS) mode. A process runs in this mode if you compile the program with the TADS compiler option set and run the program with the TADS task attribute set. TADS mode gives ALGOL, C, COBOL74, COBOL85, or FORTRAN77 processes access to the TADS facility for debugging programs. You can prevent unnecessary duplication of code segment dictionaries by using TADS mode only for the rare cases when you are actually doing debugging.
-
If the object code file is overwritten. An object code file can be overwritten if, for example, you recompile the program or use a COPY statement to replace it with a different program having the same title. If the object code file of a running process is overwritten, the system retains the old object code file as a temporary file. The running process continues to use its code segment dictionary and the old object code file. However, any new processes that are initiated with the same object code file title receive a code segment dictionary reflecting the new object code file. The main point to bear in mind is that updating or removing an object code file has no effect on processes that are already running.
The MP (Mark Program) system command can be used to assign various options to object code files. These options are described in Establishing Process Identity and Privileges. Be aware that these options do not affect instances of the program that are already running when the MP command is entered.

