LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network Stream(memory leak)

Solved!
Go to solution

Hi all, I was using Network Stream and found that it leads to memory leaks under certain circumstances, the procedure is as follows:

reader.vi

reader.vireader.vi

writer.viwriter.vi

When I run Reader.vi first and then loop through Writer.vi to send data, it causes the program memory to keep increasing, I don't understand what the problem is, because Reader.vi calls "Destroy Stream Endpoint" after each read. after each read, but the memory doesn't seem to be freed. And when Reader.vi is stopped, the memory is still not freed and will continue to increase when it is run again. I've uploaded the program as an attachment and hope someone can answer my question, it's driving me crazy.

 

For the endpoint name and URL settings, I refer to the labview help documentation.

屏幕截图 2023-05-08 094703.png

 

The design of the program is based on this page.

屏幕截图 2023-05-08 154216.png

 

If you are reading this post, please help me test this code to confirm if there is a memory leak in this program, thanks!

0 Kudos
Message 1 of 3
(899 Views)
Solution
Accepted by topic author Wlison

I would guess this comes down to LV memory management and memory fragmentation. It's not a leak per se, but a case of unusable memory holes and/or LVs memory management only returning memory sporadically.

 

Why do you close the stream? Reuse it instead like with any ref and i'd wager your memory will be stable. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 3
(784 Views)

You're right, but it doesn't fit my application scenario, and it's a problem that some computers have and some don't. Very strange.

0 Kudos
Message 3 of 3
(744 Views)