Using Shared Memory

In most UNIX and Linux environments, ACUCOBOL-GT supports the ability to have multiple users share the same copy of a COBOL program's object code in memory. This conserves memory and can lead to improved system performance by reducing the amount of memory paging that the system must do.

Note: Use of shared memory is recommended only in cases where there is a problem with excessive swapping due to too many users for the amount of memory in the machine. If you are not experiencing this problem, enabling shared memory will probably not improve performance. If you are having a problem with limited memory and excessive swapping, then the advantage of reduced swapping usually more than offsets the overhead added by using shared memory. Note that the overhead for using shared memory varies from machine to machine.

The UNIX code sharing facility is built on top of the UNIX System V shared memory facility. In order to use this code sharing, your machine must support shared memory in accordance with the UNIX System V Interface Definition (SVID) and must also have shared memory support enabled in its system kernel. Many UNIX and Linux vendors supply machines with shared memory already enabled, but others require that you reconfigure your kernel to use shared memory. Contact your UNIX vendor if you need additional information on this subject.

One easy way to tell if ACUCOBOL-GT supports code sharing on your machine is to check the files that are installed with the runtime system. If you receive a file called acushare, then that system has the ability to share code. If you do not receive this file, code sharing is not available on that machine (most likely because that machine does not adequately support shared memory).

To share program code under ACUCOBOL-GT, you must perform the following steps:

  1. Install acushare.
  2. Edit your COBOL configuration file to specify the programs you want to share. See Indicating Programs to Share for more information.
  3. Start the acushare program. After it's started, you can use the program to perform other tasks. See Using acushare for more information.