05-08-2023 03:24 AM
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.vi
writer.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.
The design of the program is based on this page.
If you are reading this post, please help me test this code to confirm if there is a memory leak in this program, thanks!
Solved! Go to Solution.
05-10-2023 07:05 AM
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. 🙂
05-11-2023 09:08 PM - edited 05-11-2023 09:09 PM
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.