Skip to main content
Previous sectionNext section

$ZSTORAGE

Contains the maximum available memory for a process.

Synopsis

$ZSTORAGE
$ZS

Description

$ZSTORAGE contains the maximum amount of memory, in Kbytes, for a job’s process-private memory. This memory is available for local variables, stacks, and other tables. This memory limit does not include space for the routine object code. This memory is allocated to the process as needed, for example when allocating an array.

Once this memory is allocated to the process, it is generally not deallocated until the process exits. However, when a large amount of memory is used (for example greater than 32MB) and then freed, InterSystems IRIS attempts to release deallocated memory back to the operating system, where possible.

You can also use $ZSTORAGE to set the maximum memory size. For example, the following statement sets the job’s maximum process-private memory to 524288 Kbytes:

   SET $ZSTORAGE=524288
Copy code to clipboard

Changing $ZSTORAGE changes the initial value for the $STORAGE special variable, which contains the current available memory (in bytes) for the process.

  • Maximum: SET $ZSTORAGE=-1 sets the $ZSTORAGE to the maximum value of 2147483647.

  • Minimum: SET $ZSTORAGE=256 sets the $ZSTORAGE to the minimum value of 256.

  • Default: The $ZSTORAGE default is the value set in the Maximum per Process Memory (KB) system configuration setting. In the Management Portal, select System Administration, Configuration, System Configuration, Memory and Startup. Changing Maximum per Process Memory (KB) changes the $ZSTORAGE value for subsequently initiated processes; it has no effect on the $ZSTORAGE value for current processes.

$ZSTORAGE values larger than the maximum or smaller than the minimum automatically default to the maximum or minimum value. $ZSTORAGE is set to an integer value; InterSystems IRIS truncates any fractional portion (if specified).

Example

The following example sets $ZSTORAGE to its maximum and minimum values. Attempting to set $ZSTORAGE to a value (16) that is less than the minimum value automatically sets $ZSTORAGE to its minimum value (256):

  SET $ZS=256
  WRITE "minimum storage=",$ZS,!
  SET $ZS=16
  WRITE "set to < minimum sets to minimum storage=",$ZS,!
  SET $ZS=-1
  WRITE "maximum storage=",$ZS,!
Copy code to clipboard

See Also

SET command

KILL command

$STORAGE special variable