Chapter Contents


SAS Companion for the OpenVMS Operating Environment

Optimizing Memory Usage

You can make tradeoffs between memory and other resources. This is explained in Data Set I/O and External I/O. To make the most of the I/O subsystem, you need to use more, larger buffers. These buffers are allocated out of your available virtual address space and must share your physical address space (that is, your working set) with the other memory demands of your SAS session.

Therefore, optimization of other resources is often at the expense of using more and more memory. If memory is your critical resource, there are several things you can do to reduce the dependence on increased memory. However, most of these techniques are at the expense of increased I/O processing or increased CPU usage.

Increasing the values of the MBC= and MBF= external I/O statement options, the CACHESIZ= option, and the BKS= option enables you to optimize the I/O subsystem by reducing the number of accesses necessary to reference the data. But reducing the number of accesses uses more memory. If you are operating in a memory-constrained environment, you need to reduce these values to minimize memory usage.

The size of your I/O buffers depends on your working set size. It is important not to increase I/O buffers up to the point that you exhaust your available working set. If you do this, you will notice an increase in the page fault rate for your job.

Using the LOADLIST= System Option

Another way to optimize memory usage is to ensure that images that are used most often are installed as known images to the OpenVMS operating environment. If you use the LOADLIST= system option, the SAS System reports which images were used most often. If you install the most heavily used images as known images, they do not require additional physical memory if used by multiple users. For information about using the INSTALL utility, refer to Installation Instructions and System Manager's Guide for the SAS System, Release 8.01, under OpenVMS. For information about the LOADLIST= system option, see LOADLIST=.

Using the UNLOAD System Option

A final technique to improve memory usage is to ensure that you make proper use of the UNLOAD system option. If your application performs many unique tasks, turn the UNLOAD system option on. Then, after each PROC and DATA step ends and after each window is brought down in the windowing environment, the SAS System purges from memory the SAS images associated with the step that just ended. Thus, memory is freed for use in the next step. In applications that perform the same tasks over and over, specify NOUNLOAD.

Specifying NOUNLOAD keeps images in memory. This strategy is effective for jobs that run the same small set of procedures again and again, and SAS System performance can be significantly better. However, if a procedure is used only once, there is no performance gain made by specifying NOUNLOAD. In fact, with NOUNLOAD, a job that uses many different procedures (or windows) can fill up even a large memory space, forcing excessive page faulting and thus degrading performance. In large performance jobs, alternating between UNLOAD and NOUNLOAD can increase performance in other sections. Consider the following example:

options unload;
proc print;
proc sort;
proc contents;
proc datasets;
proc access;

options nounload;
proc means data=x;
proc freq data=x;
proc means data=y;
proc freq data=y;
proc means data=z;
proc freq data=z;
proc means data=w;
proc freq data=w;

options unload;
proc dbload;
proc fsedit;
proc sql;
Using NOUNLOAD keeps the MEANS and FREQ procedures in memory during the time span when they are used again and again. Once you finish with these procedures, specify UNLOAD to clear memory for upcoming steps.

For more information about the UNLOAD system option, see UNLOAD.

Enabling Privileged Unloading

The SAS System uses dynamic loading. Dynamic loading allows a module to be called that was not originally linked to the base image. Dynamic unloading disassociates a called module from the base image. Dynamic loading and unloading together reduce resource usage and modularize the SAS System.

Resource usage is reduced because resources are only allocated when they are going to be used. Modularization helps develop and maintain the software, while minimization of resources enhances operating system efficiency. Although OpenVMS does not support a method of completely dynamically unloading images, the SAS System frees certain resources allocated by an image. For example, virtual address space can be deleted and channels freed. There are also resources that require privilege to free. These resources are allocated out of your process control region. The privileged unloader dynamically frees these resources back to the operating environment.

To minimize page faulting, the base image size has been kept to a minimum using modularization. Additional products can easily be added because individual modules can be sent to users without reinstalling the entire SAS System. You will notice performance gains because pages are faulted into a working set only when they are needed. For instructions about how to install and enable privileged unloading, refer to Installation Instructions and System Manager's Guide for the SAS System under OpenVMS Alpha and VAX.

You can use the UNLOAD system option at any time in a SAS session, but the new specification takes effect only after a DATA step or procedure (SAS task). Images can also be automatically removed during resource-critical situations. The SAS System prompts you in these situations for which resources to free and which to keep. In extreme situations, the SAS System takes whatever steps are necessary to continue.

Disabling Privileged Unloading

For instructions about how to de-install and disable privileged unloading, refer to Installation Instructions and System Manager's Guide for the SAS System under OpenVMS Alpha and VAX.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.