LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does system exec cause a memory leak to occur?

Sorry if this has been posted before, but I can't quite figure out why this VI is causing a gigantic memory leak (losing nearly 500K of memory a second). It's a simple system exec call, and I even trivialized everything in order to try and discover the problem.

 

Does anyone see a huge problem here? I've tried calling up taskkill afterward as well, though that seemed to make little difference.

 

If you don't trust my trivial program (and you probably shouldn't), I've also included the source files for the program - it's a one-line C++ program that returns immediately.

 

Any insight is greatly appreciated.

 

Thanks!

0 Kudos
Message 1 of 3
(2,649 Views)
Try putting a wait - even a 0 second wait - in your loop and see if it makes a difference.  Without a wait, LabVIEW will try to run that loop as fast as possible, possibly so fast that it never yields time to free resources.
Message 2 of 3
(2,637 Views)
I am not seeing the behavior you're describing with the example you provided. So, I'd guess the problem may lie in the C code you wrote.
Message 3 of 3
(2,607 Views)