This article explains the causes of out-of-memory errors in TestStand systems and outlines a debugging process that can be followed to identify and resolve memory growth issues.When creating a TestStand sequence that runs for extended periods of time, a key concern is creating sequences and code modules that do not cause significant memory growth over time. During development, it is important to carefully manage memory in test sequences and code modules to avoid out-of-memory errors.
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 that would require investigation. 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 instead.For these reasons, troubleshooting a memory growth issue is a methodical process in which memory usage data must be analysed to understand the type of growth that is occurring. To begin, narrow down the test code to a simplified version which reproduces the memory growth, and examine the simplified code to resolve the memory growth issues. This process is described below in a step-by-step guide.The other documents in this series are linked at relevant points in the troubleshooting process. They will provide details on the troubleshooting steps that should be taken, as well as guidance on how to interpret the results gathered 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.