From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT Memory Leak, CRio 9081

Running this code on a CRio 9081, only monitoring system resources. The memory continues to decrease until the CRio crashes and does not recover. I've my real code is much more comples than this, with FPGA FIFO reads, calculations, arrays, live updating xy-graphs. I remove everything and still the memory disintegrates over about 40hrs. Any ideas? LAbview 2015, recently reformatted CRio drive and reupdated software. Jim

Download All
0 Kudos
Message 1 of 12
(4,909 Views)
attachment didn't upload, try again. My code is only a While loop that reads system resources, with a 200ms "Wait" function.
0 Kudos
Message 2 of 12
(4,906 Views)

Still have the problem.  Ni support found an issue with an RT system status vi that actually causes a memory leak.  I'm now using property nodes to query system resourses and still have a problem.

0 Kudos
Message 3 of 12
(4,762 Views)

Hey Jim, I went ahead and ran your code and was experiencing the same issue you described. I fixed it by replacing the system session out tunnel in the while loop with a shift register. I believe it was creating a new reference to the system session each iteration of the while loop which was causing the problem. 

Message 4 of 12
(4,739 Views)

Hi Sam,

Interesting, I'll give it a try.  Thanks for the response.

 

Jim

0 Kudos
Message 5 of 12
(4,726 Views)

Hi Samazing,

I fixed a couple of these style references in my main code to be safe.  Still though when I query memory often I see a leak.  I now have had my code running for over 12hrs and will intermittenltly query system resources, I don't see any general memory problem.

 

I"m happy for now with this issue and feel there is a problem in this RT system if you request system resourses too often.  That makes it hard to coorelate your code related memory leaks.  Hopefully NI will find a solution for this problem.  Maybe it is only an issue on Pharlap RT systems though.

 

Thanks again.

 

 

0 Kudos
Message 6 of 12
(4,698 Views)

I seem to be having the same problem.  

Using Remote Panel to log in to LabVIEW RT 14.0 and view System Status information, which is writting to a Chart once a minute.  This is the only thing that is running on the RT.  Looks like it might settle out after a few hours, I'm not sure.  I'm going to add actual code and see what happens, next.  I needed a baseline to determine if my code has a leak or the OS does.  I use Queues and Events over multiple loops.  

 Sys_Util-Only.jpg

 

0 Kudos
Message 7 of 12
(4,605 Views)

Hi,

Be careful and don't read the memory too often.  I found that reading the RT resource vi too often was causing my problem.

I'm reading every 10s or so now and no longer see the problem. 

 

I have some updating graphs that I"m writing to arrays, but delete 1/2 of the values after reaching a threshold, ie,  once I have 1000 points I delete the earliest 500.

That seems to work fine for longer term monitoring for me.  I've been through all the "insert into array" issues but don't see a problem anymore.

 

 

0 Kudos
Message 8 of 12
(4,593 Views)

Also reading  the CPU loads were causing a problem.  An engineer from Ni suggested reading loads from a property value but I couldn't get the property reference to work and didn't want to spend much more time on the issue.  I removed reading CPU loads.  There is something funky with the Pharlap system it seems.

0 Kudos
Message 9 of 12
(4,588 Views)

Is your chart history growing unbounded?  If so, that'd look a lot like a memory leak.

0 Kudos
Message 10 of 12
(4,565 Views)