If you have eliminated all code modules from your test sequence and still see memory growth during the test system execution, settings within TestStand itself may be contributing to the memory growth. There are several reasons why TestStand could be causing memory growth.
Result Collection and Report Generation
One of the most common contributors to memory growth in TestStand systems is the result collection and reporting process. If result processing and report settings are not configured to conserve memory, you may see memory growth as test results are collected and retained in memory. In test sequences which execute for a long period of time or generate a large number of results, this can eventually result in an out-of-memory error.
For information on configuring result collection and reporting settings in TestStand to optimize memory issues, refer to the Addressing Memory Issues with Report Generation in TestStand document.
Object, File, and Device References
As a test system executes, variables are commonly used to store references to files, hardware devices, or TestStand PropertyObjects for use by steps in the test sequence. If these references are not properly released when they are no longer needed, the TestStand process will retain these objects in memory. If the reference is not released when the execution has completed, a reference leak may occur. This can cause memory to continue to grow as the test system is executed multiple times.
To identify whether memory growth is occurring as a result of references not being released properly, inspect the test sequence to determine where references are being opened and closed. This will help ensure that any references opened are being properly closed before the test sequence completes execution. If you are passing references into code modules, you may also use memory profiling tools within the code module environment to determine whether references are being closed properly.
When using the TestStand API within your test sequence or a code module, it is common to create references to sequence files, sequences, or other TestStand objects. When you create a reference to a TestStand object, you must release the reference before the execution completes. If you do not release a TestStand reference properly, you may see a PropertyObjects Were Not Released warning dialog when you exit the TestStand Sequence Editor or your user interface. This dialog will often indicate the type of TestStand reference that is being leaked, which may allow you to locate the reference that is not being released.
You must enable the Report Object Leaks feature in TestStand to see the warning dialog when a reference has not been released properly. Complete the following steps to enable the dialog:
- Click Configure » Station Options and navigate to the Preferences tab.
- Click the Debug Options button.
- Enable the checkbox for the Report Object Leaks option.
Note that the PropertyObjects Were Not Released warning dialog does not list reference leaks in the following adapter code modules:
- In LabVIEW VIs, because LabVIEW automatically releases leaked references when the LabVIEW adapter unloads the VI, which occurs before a TestStand application exits.
- In .NET assemblies, because TestStand releases the .NET app domain used by executions before a TestStand application exits.
Using Variables to Store Large Data Sets
Memory growth can also occur in TestStand if the test sequence is using variables to store large amounts of data in a container or array. If your test sequence is storing measurements or other large sets of data in TestStand variables, consider modifying the test sequence to store this data in another location such as in a file stored on disk.