08-12-2011 03:48 PM
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?
Solved! Go to Solution.
08-12-2011 04:22 PM
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
08-12-2011 04:45 PM
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...
08-15-2011 11:21 AM
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
08-15-2011 11:30 AM
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.