NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand 2010 Memory Leak when calling sequence in New Thread or New Execution

Solved!
Go to solution

Version:  TestStand 4.5.0.310
OS:  Windows XP

 

Steps to reproduce:

 

1) Unzip 2 attached sequences into this folder:  C:\New Thread Memory Leak

2) Open "New Thread Memory Leak - Client" SEQ file in TestStand 2010

3) Open Task Manager, click Processes tab, sort A-Z (important), and highlight the "SeqEdit.exe" process.  Note the memory useage.

4) Be ready to click Terminate All in TestStand after you see the memory start jumping.

5) Run the "New Thread Memory Leak - Client" sequence.

6) After seeing the memory consumption increase rapidly in Task Manager, press Terminate All in TestStand.

7) Right click the "While Loop - No Wait (New Thread)" step and set Run Mode » Skip

😎 Right click the "While Loop - No Wait (New Execution)" step and set Run Mode » Normal

9) Repeat steps 3 through 6

 

I've removed all steps from the While Loop to isolate the problem.  I've also tried the other methods you'll see in the ZIP file but all cause the memory leak (with the exception of the Message Popup).

 

I have not installed the f1 patch, but none of the bug fixes listed appear to address this issue.  NI Applications Engineering has been able to reproduce the issue (with Windows 7) and is working on it in parallel.  That said, are we missing something??

 

Any ideas?


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 1 of 5
(4,715 Views)
Solution
Accepted by topic author LabBEAN

Hi LabBEAN,

 

In order to prevent a large amount of memory to be used you should deselect the record result run option in the properties for the While step and the End step.  The memory that is being used is storing the results for these steps and any other steps for which we are recording the results.

 

Thanks,

 

Ryan

Ryan T
National Instruments
Applications Engineer
Message 2 of 5
(4,704 Views)

Good catch Ryan!

 

Lesson learned:  Record Result defaults to True » this is a problem for indefinitely running parallel threads and executions » watch out for While and End step types...


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 3 of 5
(4,699 Views)

If you aren't actually going to wait for a thread or execution you need to also unselect the option to wait for the thread at the end of the sequence or you will effectively be leaking some memory for each thread/execution until the calling sequence completes.

 

-Doug

Message 4 of 5
(4,662 Views)

Good point Doug.  In this case parallel sequences are being launched at the beginning of the sequential process model, but I'll keep that in mind for later.  Take away:  be intentional about when to wait at the end of the sequence for threads to complete.


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 5 of 5
(4,659 Views)