Tuning the z/OS® shared library region

The shared library region is a z/OS feature designed to improve performance when loading UNIX System Services dynamic link library (.so) files. The primary exploiter of this feature is the Java SDK for z/OS, but it can be used by any product that sets the shared library bit on their shared object (.so) files.

CICS JVM servers and Node.js applications disable the shared library region by default. Doing so usually increases the available MVS 31-bit private area virtual storage within the CICS region. To enable the shared library region, you must explicitly set the variable _BPXK_DISABLE_SHLIB=NO in the JVM profile or Node.js profile.

Enabling the shared library region across multiple CICS regions can provide a performance benefit related to the one-time allocation of the associated real storage, compared to each region loading each library individually. However, if your z/OS image has many different JVM versions in use, all using the shared library region, a larger amount of virtual storage is needed in all regions to hold the different versions of the shared libraries. That increase is significant because each address space must reserve an equivalent amount of MVS high private area storage onto which it maps the shared library region. Thus, a region's private storage allocation is usually larger than if it was loading only the specific libraries required.

For more information about private storage, see High private area

Additionally, executable code in the shared library region is allocated on a megabyte boundary, allowing a single-page table to be shared, similar to LPA. A tradeoff is that the coarse-grained allocation consumes more storage than direct loading of libraries.

Individual address spaces allocate their private storage when the first process using shared libraries is started in the region. Take care that all processes within your address space opt-in, or opt-out of the shared library region consistently. If you choose to use the shared library region, the amount of storage that is allocated is controlled by the SHRLIBRGNSIZE parameter in z/OS, which is in the BPXPRMxx member of SYS1.PARMLIB. The minimum is 16 MB, and the z/OS default is 64 MB. To determine the amount of storage that is allocated, bring up your normal workload on the z/OS system, then issue the command D OMVS,L to display the library statistics. Adjust the SHRLIBRGNSIZE parameter large enough to accommodate all the libraries, but not so large that excessive storage is reserved.

Note: Note: Native libraries are loaded once per address space. Running multiple JVM servers and Node.js applications within the same CICS region will not incur additional load costs regardless of the shared library region setting, providing they use the same version of the IBM SDK, Java™ Technology Edition and IBM SDK for Node.js - z/OS respectively.