Jump to content

Article - Insidious Memory Leak


Recommended Posts

Posted

I've decided to start my own LabVIEW blog, to share random observations and debugs which I believe could be helpful to my fellow LabVIEW jockeys.

Here's my very first entry!

Feel free to leave feedback, comments, critique, etc. I hope that my insights can live up to the high standards of this community.

Posted

Hehe, I've been burned by stuff like that. In general, one shouldn't obtain a reference (to anything) inside a loop, especially if that reference isn't closed on the same iteration.

Posted

Congratulations on the new blog.

I assume that this happens because RT doesn't do some optimizations which LabVIEW on Windows does in order to keep the RT run-time smaller and lighter.

Posted

QUOTE (Yair @ Jul 8 2008, 07:43 PM)

I assume that this happens because RT ....

Sorry to disappoint you, this happens on any given platform. Every iteration a new queue reference is created, this is 4 bytes of data. By creating a loop at 5 ms I could easily see the memory usage rise of LabVIEW.

Ton

Posted

I was thinking of adding that I'm actually a bit surprised and that I would actually expect it to behave the same way on both platforms (either to optimize or to perform the code literally), but I decided against it, since I figured that Bob probably had a reason to say that it worked fine. I guess I should have tested it myself. :oops:

Posted

QUOTE (Yair @ Jul 8 2008, 02:47 PM)

I was thinking of adding that I'm actually a bit surprised and that I would actually expect it to behave the same way on both platforms (either to optimize or to perform the code literally), but I decided against it, since I figured that Bob probably had a reason to say that it worked fine. I guess I should have tested it myself. :oops:

Well, to the extent that I tested it under Windows, it appeared to work fine. The RT systems were left running overnight and over weekends, and that's when the memory leaks would eventually cause things to crash. We never did long-term tests under Windows.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.