Jump to content

Article - Insidious Memory Leak


Recommended Posts

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.

Link to post

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.

Link to post

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

Link to post

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:

Link to post

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.

Link to post

Join the conversation

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

Guest
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.