Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter ThreeData Types and Operators (continued)

ReleaseWorkingPoolSpace Function

Overview

The ReleaseWorkingPoolSpace function trims the internal working string pool size.

Syntax/Parameters

Syntax

int = ReleaseWorkingPoolSpace ( );

Parameters

(none)

 

Return Value

Returns an int as ERROR_NONE.

Remarks

Each script engine will employ an internal working string pool that is used to store data being passed to various functions internally. GetWorkingPoolSize is a tool to help understand how much memory is being used to transition data.

The pool can grow rather large if progressively larger strings are manipulated. For example, adjusting and accumulating strings in the range of hundreds of megabytes in size. ReleaseWorkingPoolSpace will cap the pool memory at the current working location and release the remaining memory.

Transitional data is information used to perform string math and functions. For example, if FileToString is run, the result is placed on the working string pool and then stored in memory. The remaining space in the working pool is reused but not released.

When releasing memory, it is best to do it at the lowest level in the stack as possible. For example, large strings are passed to functions down the stack and ReleaseWorkingPoolSpace is called at that depth, it will be less effective.

The principal use of ReleaseWorkingPoolSpace is to allow the engine to give up large allocations of memory that are no longer needed. For example, a continuously running script performs a periodic task involving very large strings or arrays, this function can be used to return some space to the local heap and to the system.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic