LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp memory leak?

Running LV8.2.1.

 

I have two applications on seperate pc's with one pc sending data to the other over a network using labview's TCP vi's. Both are using vi's based on the simple vi LV examples. One of the vi's is also communicating, not with TCP directly but with Shared Variables, over a different network connection to LV real-time on a PXI chassis.

 

After about  15 minutes the communications with the RT chassis starts to give waitnig errors, and after about an hour I lose control over the entire program. Also, memory usage goes up dramatically, using up to close to 100% if I run long enough. If I stop the program sending data, I don't regain control, but if I start up the program without the TCP communications, I can run for days without problems.

 

After suspecting the TCP code, which is run as a seperate LV application, was causing the problem, I rewrote the code in c#. The C# code communicates with the main LV code using a single Shared Variable, the same way as the LV code. It now runs, at least for several hours, with no RT communications problems or increased memory usage. So far, I haven't been able to run for more than a few hours because the other LV program, which was written by another company, still uses the LV TCP code and now it stops when it runs out of memory. I'm going to try to have them re-write their code, unless someone has a better idea.

 

Another thing that is happening is that when I run my TCP vi, the one recieving the data,  without running the main program, the program on the other pc slows down after about 15 minutes.

 

I have seen some hints about what to do when I searched for "Labview TCP memory", but the main idea, which was to change the variable from string to byte array didn't work. There was also something called a "Wire Nut", but I haven't figured out whether it is a joke or not.

 

So, does anyone no what the problem with TCP, or something else could be?

 

Thanks.

 

Chuck

0 Kudos
Message 1 of 3
(2,347 Views)

I haven't played much with RT in 8.2.1, so I don't have an idea if there is a known issue.

But I would suspect your code first, do you open the TCP connections inside a loop without closing the TCP connection?

This would create a memory lake.

 

Could you show a screenshot of your code?

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 3
(2,336 Views)

Hi Ton,

 

Thanks for the quick reply.

 

My vi is to wide to get it all in a screen capture. But I took a closer look at my code and noticed that I had disabled the TCP Close vi. I'll try the vi with the Close enabled when I get a chance. I'm not sure what the guys at the other end are doing, but I'll talk to them and see if the Close is done.

 

Thanks.

 

Chuck 

0 Kudos
Message 3 of 3
(2,317 Views)