Please enable JavaScript to view this site.

ESL Documentation

Response Definition

Respond to minimum free memory threshold.

response to low memory

[ACTION_STATEMENT] ...

ACTION_STATEMENT

An action statement.

Description

The response to low memory statement is taken when ESL reaches a minimum threshold of available memory during execution. The threshold is set either by you in the set low memory threshold action statement, or by the default value of 5000 bytes.

Before executing the response to low memory statement, ESL will attempt to increase available free memory by increasing the program memory size. If this fails, or if the amount of program memory has reached the maximum specified in EslConfig.ini, the response to low memory statement is invoked.

There can be only one response to low memory statement in a program. During runtime, ESL processes an internal program memory check after execution of each response statement.

The response to low memory statement will not be invoked if ESL is within a loop, since ESL checks memory only after the execution of a response statement, and a loop consists of a series of continuous action statements.

A response to low memory statement cannot be inside a block. This response will interrupt a guarded block.

You can use the freesize function to monitor memory usage within your program.

Example

response to low memory

  squeeze memory

if (freesize < 2000) then

  action Warn_User

end if

See Also

freesize Special Inquiry Built-in Function

set low memory threshold Action Statement

squeeze memory Action Statement