Managing Memory Usage in NI TestStand Sequences

Updated Jun 7, 2023



  • TestStand

My sequence contains several code modules. NI TestStand uses a lot of system memory when the sequence runs. Is there a way to minimize the amount of memory used throughout the sequence?

By default, a sequence's code modules are loaded before the sequence executes and unloaded after the file containing the sequence is closed. However, if a sequence contains several hundred code modules, then the test station may run into memory usage problems. This can be managed by changing the way a code module is loaded and unloaded.

For a specific step, the management settings can be found by right-clicking and selecting Step Settings. In the Step Settings pane, select Properties » Run Options. For a Sequence File, access the settings by going to Edit » Sequence File Properties » General in your Sequence Editor.

The default setting for the load option is "Preload when execution begins." If this option is selected, then NI TestStand will load all the code modules when a Sequence begins to execute. If  "Load dynamically" is selected, then a code module is loaded only when the step executes it.

The default setting for the unload option is "Unload when sequence file is closed." If this option is selected, then all code modules are kept in memory, even after the execution of the sequence. The other unload options include "Unload when precondition fails""Unload after step executes," and "Unload after sequence executes." Selecting one of these options ensures that the code modules for a Sequence File are not all in memory at the same time.

Additional Information

Manually setting the load and unload options for each step can affect the performance of the test sequence.

Setting the load an unload options for a subsequence call does not propagate these settings to its constituent steps. Be careful to set load and unload options for steps and not subsequence calls.