SF (Set Factor)

The SF (Set Factor) command displays or sets the memory management parameters for the entire system. You can use the O (Overlay) command to display relevant information about the overlay factors that are set in the SF command.

Syntax

<factor list>

<number>

The following are the valid ranges of values for <number> for each factor.

Factor

<number> Range

Units

1

0 through 99

%

2

0 through 99

%

3

1 through 999

%

4

1 through 50

%

5

0 through 65535

words

6

1 through 100

%

7

1 through 100

%

Explanation

SF

Displays the current memory management parameters:

  • Factor 1, OLAYGOAL

  • Factor 2, AVAILMIN

  • Factor 3, FACTOR

  • Factor 4, OVERLAYABLEMIN

  • Factor 5, BUFFERGOAL

  • Factor 6, OLAYSATURATION

  • Factor 7, OLAYCHANGE

SF <number>

Sets the value of factor 3, FACTOR, to <number>. FACTOR is the default; it is assumed when the command does not specify a factor to be set.

SF <factor list>

If the numbers in an SF command are preceded by 1, 2, 3, 4, 5, 6, or 7, the value is assigned to the first, second, third, fifth, sixth, or seventh parameter, respectively. The factors are described in the paragraphs that follow.

Factor 1: OLAYGOAL

Together with Factor 2 (AVAILMIN), the OLAYGOAL factor controls the rate at which overlayable memory is to be overlaid on a per-minute basis. The independent runner WS_SHERIFF does the overlaying.

If both OLAYGOAL and AVAILMIN are 0 (zero), WS_SHERIFF just cleans up lists of available memory. The rate at which WS_SHERIFF runs is determined by OLAYGOAL as follows, where the calculation gives the total percentage of processor resource used by WS_SHERIFF:

0.1% + (OLAYGOAL * 0.05%)

WS_SHERIFF performs the following tasks:

  1. Moves non-overlayable memory out of high memory.

  2. Moves overlayable memory out of low memory.

  3. Compacts non-overlayable memory.

  4. Combines adjacent small available memory areas into larger available memory areas.

  5. Optimizes the location of the memory top of save pointers in the MEM_TOSS array.

When the value of OLAYGOAL is greater than 0, overlaying is enabled for WS_SHERIFF, and OLAYGOAL is used as follows:

  • If less than AVAILMIN percent of system memory is available and less than 25 percent of overlayable memory is in the least recently used (LRU) list, approximately OLAYGOAL percent of overlayable memory is placed in the least recently used (LRU) list per minute. Otherwise, OLAYGOAL percent squared of overlayable memory is placed in the LRU list per minute. For example, if OLAYGOAL is 1 percent, then 0.01 percent of overlayable memory is placed in the LRU list. The memory is not overlayed at this point.

  • OLAYGOAL is used to determine the rate at which the LRU list is overlaid to disk:

    • If the amount of available memory is less than AVAILMIN percent of system memory, the LRU list is overlaid at a rate of OLAYGOAL percent per minute.

    • Otherwise, if available memory is less than 2*AVAILMIN percent of system memory, the LRU list is processed at OLAYGOAL percent squared per minute.

    • Otherwise, if there is anything in the LRU list, one area is written to disk every few seconds.

Setting OLAYGOAL to a value greater than 0 (zero) also causes the system to use a different algorithm in determining whether enough memory is available to start a job or task. Refer to the System Operations Guide for further information.

It is recommended that OLAYGOAL be set to 5 or above under the conditions of extreme SAVE memory allocation, such as very large database warmups.

Factor 2: AVAILMIN

AVAILMIN interacts with OLAYGOAL to determine the rate at which WS_SHERIFF overlays memory to disk and reshuffles memory. See the preceding description of OLAYGOAL for an explanation of the relationship. If both OLAYGOAL and AVAILMIN are 0 (zero), WS_SHERIFF just cleans up lists of available memory.

Factor 3: FACTOR

This factor is used only for scheduling. 

If the STRICTSCHED option (option 39) is set:

The amount of physical memory is multiplied by FACTOR% and used as a limit in determining whether a task runs or is entered into the “scheduled” state. If the in-use memory + overlaid memory + task memory estimate exceeds this number, the task is “scheduled.”  For example, if the total memory on the system is 100,000,000 words, and the FACTOR is set to 110, the amount of memory in use or overlaid cannot exceed 110,000,000, regardless of how much memory is available. This means a task that requires 1,000,000 words to run is scheduled if the in-use memory adds up to 100,000,000 and the overlaid memory is 9,100,000 words, that is,  (100,000,000 + 9,100,000 + 1,000,000) = 110,100,000 words, which is greater than 110,000,000 words.

If the task is not "scheduled" according to the rules for STRICTSCHED (option 39), or if STRICTSCHED is not set, a memory estimate of a task is divided by the value of FACTOR to determine whether enough memory is available for the task to be started. Suppose a memory estimate of a task is 10,000 and FACTOR is set to 200 percent. The scheduling algorithm uses a memory estimate of 5,000 (10,000 divided by 2.00) to see whether enough memory is available to start the task.

Factor 4: OVERLAYABLEMIN

This factor specifies the percentage of system memory to be used for allocating overlayable memory. This factor is not a limit on the maximum amount of memory that can be allocated for overlayable memory. Instead, it defines a contiguous range of memory at the high-address range of memory below the memory ceiling. Save memory is not allocated from within this region if the beginning address of either an available space or an overlayable in-use space exists within this upper region of memory. Overlayable in-use space within this region can still be overlaid when allocating overlayable memory. The low-address boundary of this space is denoted as the OLAYFENCE.

Using the OVERLAYABLEMIN factor minimizes thrashing that might occur when save memory allocation exceeds 90 percent of system memory. The other use is to reduce checkerboarding between save in-use and overlayable in-use memory as well as checkerboarding between save available and overlayable available memory that can result from the rapid buildup of save in-use memory and rapid deallocation of that save in-use memory, subsequently followed by another cycle of rapid save memory allocation and deallocation. Typically, the default percentage of 1 percent or a few percent more should be sufficient to prevent save memory allocation from inhibiting normal system functionality. But, setting the OVERLAYABLEMIN factor to a higher percentage before the tearing down of an application environment that requires a high percent of save in-use memory can limit possible checkerboarding of the available lists, and subsequent checkerboarding of in-use memory during a rapid buildup of save or overlayable memory.

Factor 5: BUFFERGOAL

This factor specifies the minimum value, in words, that can be used for the default buffer size for files with a FILESTRUCTURE attribute value of BLOCKED or STREAM. In general you should not specify a value for this factor. The system default value should provide an adequate buffer size. To restore the system default value, set factor 5 to 0 (zero). The default value is 20000 words. Refer to the description of the BUFFERSIZE attribute in the File Attributes Programming Reference Manual for more information.

Factor 6: OLAYSATURATION

OLAYSATURATION determines the level of processor usage that can be used for overlay activity. If the processor usage exceeds the value of OLAYSATURATION and OLAYGOAL is 0 (zero), new tasks are scheduled. The default setting is 15%.

Factor 7: OLAYCHANGE

OLAYCHANGE provides control over the smoothing of system overlay activity. The calculated overlay activity is used to determine if the OVERLAYSATURATION (SF 6) threshold has been exceeded. This smoothing factor is used in the calculation only when the amount of overlay activity is decreasing. If overlay activity is increasing, the actual level of overlay activity is used to determine overlay saturation. The default setting is 10%.

Examples

Example 1

This example shows an SF display:

SF
  1) OLAYGOAL = 5% PER MINUTE
  2) AVAILMIN = 10%
  3) FACTOR = 110%
  4) OVERLAYABLEMIN = 1%
  5) BUFFERGOAL = 5000 (DEFAULT)
  6) OLAYSATURATION = 15%
  7) OLAYCHANGE = 10%

Example 2

This example sets factor 2 (AVAILMIN) to 10 percent and factor 1 (OLAYGOAL) to 5 percent:

SF 2 10 1 5
  1) OLAYGOAL = 5% PER MINUTE
  2) AVAILMIN = 10%
  3) FACTOR = 110%
  4) OVERLAYABLEMIN = 1%
  5) BUFFERGOAL = 5000 (DEFAULT)
  6) OLAYSATURATION = 15%
  7) OLAYCHANGE = 10%

Example 3

This example sets factor 5 (BUFFERGOAL) to its default value:

SF BUFFERGOAL 0