


For many UNIX machines, ACUCOBOL-GT supports the ability to have multiple users share the same copy of a COBOL program's object code in memory. This configuration variable indicates which programs you want to share code. Use of shared memory is recommended only if you have a problem with limited memory and excessive swapping. In this case, the advantage of reduced swapping will usually more than make up for the overhead added by sharing memory. To use shared code for all of your programs on UNIX, add the following line:
SHARED_CODE 1
This will cause all programs to attempt to share code. Every code segment loaded into memory will be placed into shared memory until shared memory is full. Further code segments will then be placed in conventional memory.
Since shared memory is a limited resource under UNIX, you will usually want to restrict the use of shared code to those programs where it will be most beneficial. This will ensure that other programs do not use up all of the available shared memory first. To do this, specify each program you want to share as follows:
SHARED_CODE Program1
SHARED_CODE Program2
SHARED_CODE Program3
When you use this method, "Program1", "Program2", and so forth are the PROGRAM-IDs from the programs' Identification Divisions (note that a program's object file name is not used). If you use this method, then setting SHARED_CODE to "1" will have no effect.
For additional information, see the User's Guide, section 2.12, "The acushare Utility Program."