10-21-2020 04:55 AM
I have problems with my compactRIO 9031 (NI Linux RT x64) and LabVIEW 2018 SP1. I've deployment a message handling loop design pattern, with Real-Time target and FPGA. After two hours of running, the controller rebooted itself due to a lack of virtual memory.
In order to figure out if the problem comes from programming' errors, I've done several tests with a simple code which I attached, and also with an old cRIO (9012) with LabVIEW 2009 and OS VxWorks.
The code is very simple, two random numbers are generated in RT RAM Test .vi and are sent to FPGA RAM Test.vi to be used as arguments in an addition operation. The FPGA loop runs every 700 us.
The data set of generated numbers, FPGA operation, CPUs’ loads, Total Virtual/Physical RAM is converted to waveform and recorded in a .tdms file every 15 minutes.
The RT RAM Test is embedded and set to run as startup.
After 2 hours (4, in cRIO 9039 device which has double memory capacity than cRIO 9031) the application stops itself after consuming 80-90 MB each recording step and it ran out of memory.
The problem keeps happening independently of the programmed code used.
Any tips to help me with my problem? Has anyone dealt with the same thing?
Thanks in advance
Solved! Go to Solution.
10-21-2020 05:11 AM - edited 10-21-2020 05:13 AM
Hi Franinge,
writing to TDMS file will need some memory buffers to handle all that extra stuff done for TDMS…
You can also improve your own code:
The upper part is your loop without those Rube-Goldbergs (case structure, InsertIntoArray instead of BuildArray).
The lower part does the same as long as the "element" array has a "multiple of 10" size…
10-21-2020 05:55 AM
Thanks, GerdW. I'll take into account your recommendation but the problem had already happened before writing in TDMS. Indeed it was a quick option to guess what was happening with my cRIO that rebooted itself after a certain time running.
I'd like to know what is happening and how to solve it because it's independently of the code used. (My LabVIEW project is much larger, with many queues and arrays and the behavior of the cRIO is exactly the same as the simple RAM Test's project ones.
10-29-2020 07:44 AM
I'd like to share with the community the solution to my problem. I really appreciate the given help to Luis Sanmiguel, a member of the NI Technical Support, and to the rest of the team too.
The given solution is calling to system session property node before the while loop starts and not inside it because the program is continuously creating a reference in each loop iteration that causes a memory leak that increases over time.
The solution:
And the recording after 2 hours running: