10-16-2012 04:21 AM
Hi folks,
I have a quite strange problem that I cannot solve. So I hope you can give me some advise.
We are using TestStand combined with some LabView code modules to do some longterm testing (> 12 days). We found that after some hours TestStand runs out of memory and were able to trace this back to the reporting. We then implemented our own reporting which includes calling a VI in the PostResult callbacks and setting DiscardResults in the callback to true. We then disabled the NI reporting and could notice an improvement but still there is an increasing memory usage over time which leads to out of memory errors after several hours.
When skipping our own reporting step in the PostResult callbacks everything runs fine, memory usage stays more or less constant. After some research on why the memory usage keeps increasing I found out that if I insert a "Wait" step with at least 1-2 seconds duration directly after our reporting VI everything wents fine also. So it seems to me that TestStand isn't able to free allocated resources before the reporting VI is called the next time.
Some more details on the given setup and used VI: Our custom reporting VI takes the sequence context as an input parameter and internally gathers step results and other informations (Parameters.Result, TestSockets.MyIndex, RunState.Caller.StepId, etc.) from it. These informations are written to a textfile on the harddisk. The VI is called in the ProcessModelPostResultListEntry as well as in the SequencePostResultListEntry instead of the On-The-Fly-Step in the BatchModel-ProcessModel. We're using a slightly customised BatchModel and are running six UUTs in batch (the problem also occurs when activating only one Testsocket).
The Load Options of the VI are "Preload when execution begins" and "Unload when sequence file is unloaded", switching to "Unload after sequence executes" doesn't help either. "Unload after step executes" is not an option as inside the custom reporting VI a functional global variable (or action engine) is used to store some counters.
As said when pausing after calling the reporting VI at least 1-2 seconds everything is fine, pausing less than this leads to a constantly increasing memory usage of TestStand. Can anyone tell me why this is? And/or give me some hint to solve this problem?
Thanks. Best regards.
10-16-2012 08:31 AM
Nevermind...Found the problem. Missed to close a reference on a property object.
10-16-2012 09:43 AM
Did you discover this due to TestStand's property object leak reporting code (TestStand reports property object leaks when exiting)? Though maybe labview does close the handles eventually when the vi is unloaded so it might not get reported on exit.
-Doug
10-17-2012 01:44 AM - edited 10-17-2012 01:46 AM
No, TestStand didn't report any property object leaks on exiting. I found it while going through my VI and disabling every SubVI call step by step. It seems like LabView or TestStand can handle unclosed property objects if there is enough time between successive calls. Is there some kind of garbage collector?
10-17-2012 10:04 AM
There is no garbage collector involved unless you are also using .NET somewhere and passing these references to it. LabVIEW does probably close stray references when the VI which created them is closed though, which might be why you aren't seeing any leaks reported by TestStand.
-Doug