When creating a TestStand sequence that must run for a long duration, a key concern is creating sequences and code modules which do not cause significant memory growth over time. During development, this means that you must carefully manage memory in test sequences and code modules to avoid out-of-memory errors when the test system is executed for an extended period of time. The purpose of this document is to explain the causes of out-of-memory errors in TestStand systems and outline a debugging process that you can follow to identify and resolve memory growth issues in your test system.
It is important to recognize that memory growth does not always indicate a problem with the test system. For example, if a code module is acquiring measurement data from hardware and storing the data in an array, the code module’s memory usage will increase as the data is stored. This type of memory growth is typically expected to occur.However, if memory allocated by code modules or other test system components is not released when it is no longer needed, memory usage will continue to increase as the test system executes. This can eventually cause an out-of-memory error or crash once the test system uses all available memory. This uncontrolled memory growth over multiple test sequence iterations is often referred to as a memory leak.
Out-of-memory errors may occur for multiple reasons:
It can be difficult to track down memory growth issues in large test systems due to the amount of code executed during a test. Additionally, memory growth may not cause an error until the test system has been executing for a long period of time, and may cause a crash or other instability in the test system rather than generating an out-of-memory error.For these reasons, troubleshooting a memory growth issue is a methodical process in which you analyze memory usage data to understand what type of growth is occurring, narrow down the test code to a minimal test case which reproduces the memory growth, and examine the minimal test case to identify and resolve the memory growth issues. This process is described below in a step-by-step guide that you can follow as you investigate memory growth issues in your test system. The other documents in this series are linked at relevant points in the troubleshooting process. They will provide details on the troubleshooting steps you should take, as well as guidance on how you should interpret the results you gather at each stage in the process.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.