Global memory is used for several items, many of which are static, being allocated when the first program of an ESL application is run, and remaining fixed until the application is terminated. These static items are:
Item |
Works this Way |
I/O Control Blocks |
Use approximately 1K of global memory, which is allocated at the beginning of the first ESL program to be run; it is never freed during ESL program execution. |
Pointing Device Buffers and Control Blocks |
Use between 150 and 300 bytes; amount varies with device. The memory is allocated at the beginning of the first ESL program to be run. |
Application Buffers and Control Blocks |
Use approximately 680 bytes for each application. They are allocated when an application is started, and de-allocated when it is stopped. These buffers may expand at runtime if ESL must store large amounts of data from applications. |
The single-most dynamic area that affects global memory is that of global variables. When the first ESL program is run, there are no global variables in global memory. Working copies of global variables are maintained in local memory.
When the first program exits via a change to program statement, all global variables are copied into global memory. When the next program is run, the values of the global variables are copied from global memory to local memory. They are not copied again until the program exits, when the values are again transferred to global memory. Thus, if the application runs out of global memory, it will probably do so only after a change to program statement has been executed.
Arrays of global string variables are likely to cause global memory fragmentation. Avoid them if you are going to use the change to program statement frequently.