Memory de-allocation is not automatic for the dynamic types Skip, Array, Buffer, DB, OleAutoArgs, IPC and Stat. Repeated use of these types can consume memory and reduce performance of DOORS. In some cases this can even lead to DOORS crashing.
To avoid such memory leaks you must explicitly de-allocate memory used by these variables. This means that you should have a delete() or destroy() function call for every create() function call in your program.
There is no function for de-allocating memory used by string variables. Every new string declared or constructed in DXL is added to the “string table”. The memory used by the string table is not released until the DOORS session is terminated.
Memory being consumed by the string table is a particular problem in scripts such as Layout DXL that are run many times.
Avoid creating unecessary strings through concatenation. The following prints out object identifiers:
Object o for o in current Module do { print("Object: " identifier(o) "n") }
This is inefficient because the new strings being added to the string table are, for example
"Object: SR 1n", "Object: SR 2n", "Object: SR 3n"
Rewriting the code as follows factors out the strings “Object: ” and “n” and thus uses less space in the string table.
Object o for o in current Module do { print("Object: ") print(identifier(o)) print("n") }
New strings being added to the string table are, for example:
"Object: ", "n", "SR 1", "SR 2", "SR 3"
If you are doing a lot of string processing use Buffers instead of strings. If you need to convert a Buffer to a string you can use the undocumented function
string tempStringOf(Buffer)
Which converts a buffer to a string without using the string table. The string created is very temporary and cannot be relied upon to exist beyond the statement in which it is used.
Interestingly, string space is released if the DXL is executed within an eval_() command.