Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

max-datasize

Syntax

Hierarchy Level

Description

Maximum amount of memory allocated for the data segment during execution of a script of the configured type. The device sets the maximum memory limit for the executing script to the configured value irrespective of the total memory available on the system at the time of execution. If the executing script exceeds the specified maximum memory limit for that script type, it exits gracefully.

Note:

For op scripts, the max-datasize statement is only enforced for op scripts that are local to the device. If you execute an op script from a remote location using the op url command, the device uses the default memory allocation settings.

Note:

For op scripts run with the max-datasize statement configured for the minimum, an error occurs. In Junos OS, the error is "Memory allocation failed." In Junos OS Evolved, the error is "Out of memory."

Default

If you do not include the max-datasize statement, the default memory allocated to the data segment portion of the executed script depends on the operating system and release, which is as follows:

  • Junos OS—Allocates half of the total available memory of the system up to a maximum value of 128 MB.
  • Junos OS Evolved Release 21.4R1 and later—Allocates 1024 MB.
  • Junos OS Evolved Release 21.3 and earlier—Allocates 128 MB.

Options

size

Maximum amount of memory allocated for the data segment during execution of a script of the given type. If you do not specify a unit of measure, the default is bytes. The listed limits apply to the following types of scripts: commit, event, op, SNMP, translation, and extension service scripts.

  • Syntax: size to specify bytes, sizek to specify KB, sizem to specify MB, or sizeg to specify GB

  • Range: Table 1 lists the minimum and maximum configurable values for the statement for the different releases and script types.

    Table 1: max-datasize Range
    OS Scripts Releases Minimum (bytes) Maximum (bytes)

    Junos OS (32-bit)

    All

    23,068,672 (22 MB)

    1,073,741,824 (1 GB)

    Junos OS (64-bit)

    Commit,
    event,
    op,
    translation

    -

    23,068,672 (22 MB)

    3,221,225,472 (3 GB)

    Extension service

    16.1R3 and earlier

    23,068,672 (22 MB)

    1,073,741,824 (1 GB)

    16.1R4 and later
    16.2R2 and later
    17.1R1 and later

    23,068,672 (22 MB)

    3,221,225,472 (3 GB)

    SNMP

    21.3 and earlier

    23,068,672 (22 MB)

    1,073,741,824 (1 GB)

    21.4R1 and later

    23,068,672 (22 MB)

    3,221,225,472 (3 GB)

    Junos OS Evolved (64-bit)

    All

    21.3 and earlier

    23,068,672 (22 MB)

    1,073,741,824 (1 GB)

    21.4R1 and later

    268,435,456 (256 MB)

    2,147,483,648 (2 GB)

Required Privilege Level

maintenance—To view or add this statement in the configuration.

Release Information

Statement introduced in Junos OS Release 12.3.

Support at the [edit system extension extension-service application] hierarchy level introduced in Junos OS Release 16.1 for MX80, MX104, MX240, MX480, MX960, MX2010, MX2020, and vMX.

Support at the [edit system scripts translation] hierarchy level introduced in Junos OS Release 16.1.