Optimizing Performance: Data Continuity and Memory Management

By default, when you terminate a called Maintain procedure, Maintain clears its data from memory to save space. You can optimize your application's performance by specifying, each time you terminate a called procedure, how you want Maintain to handle the procedure's data. You have two options, based on how often you call a given procedure over the course of an application. If you call the procedure:

For more information about transactions spanning procedures, see Ensuring Transaction Integrity.

You can specify how a procedure will handle its data in memory by terminating it with the GOTO END command qualified with the appropriate memory-management phrase. The syntax is

GOTO END [KEEP|RESET];

where:

KEEP

Terminates the procedure, but keeps its data, the values of its variables and data source position pointers, in memory. It remains in memory through the next invocation, or (if it is not called again) until the application terminates. The procedure does not issue an implied COMMIT command to close an open logical transaction.

RESET

Terminates the procedure, clears its data from memory, and issues an implied COMMIT command to close an open logical transaction. RESET is the default value.

You can use both options in the same procedure. For example, when you are ready to end a child procedure, you can evaluate what logic the procedure has to perform when it is next called and then branch accordingly either to keep data in memory, saving time and providing data continuity, or else to clear data from memory to conserve space.

Note: If you call a procedure with the Keeping or Terminating the Server Session: KEEP/DROP option, WebFOCUS Maintain will clear the data from the called procedure from memory, no matter what option you choose in the called procedure.


WebFOCUS