A well-behaved ESL application will reach a point where to no further memory is required; this level of memory can be determined using the EslMemStats routine detailed above. Memory is not released back to Operating System until the application is closed. When an application continues to allocate more memory, then you must take a few moments to consider how your program uses memory to make sure that you have really solved the underlying problem. You must also remember that a “memory squeeze” cannot be performed whilst a subroutine is active, so it is not normally possible to perform the squeeze mid-way through processing an event. The low memory is also only triggered at the end of an event. It is therefore essential to ensure your application has sufficient free memory to handle the most memory “hungry” event.
Your application must also ensure memory is freed whenever possible, therefore you must delete dynamically created Regions and Controls once they are no longer required. You should also clear string by copying a null string. You must avoid continuing appending data to a string or region. For example, do not use textual regions as event or trace logs, as they will be continually appended to, which will eventually cause the memory limit to be exceeded.