Jump to content

Memory leak when attempting to set cluster elements by name


Recommended Posts

I am currently working on a project, one component of which is a OPC-UA interface to a PLC. There are approximately 100 nodes (variables). Part of my work has been to keep in mind the next iteration of the architecture needs to be able to handle approximately an order of magnitude more nodes.

Dealing with this many "variables" in LabVIEW can be painful unless some programattic techniques can be used.

For debugging it is useful to see all the node values, and so I implemented the technique shown below where the name of the variable can be used to update a cluster (nested to a maximum of two levels deep). This works well. The green VIs are the OpenG Cluster access VIs.

However I have virtually conclusively proven to myself that when this is built into an executable this portion of code shown below exhibits a memory leak of several kB per second.

Interestingly, I use a more simple version of this technique in another portion of the project to update some GUI elements, and there is no noticeable leak.

Has anybody seen this behaviour before? I have not poked too far inside the OpenG VIs, but from what I have seen they should not leak anything.

Memory Leak.PNG

Link to comment
On July 6, 2016 at 1:46 PM, hooovahh said:

 Oh and if you update the cluster you need to set the Cluster size in the Array to Cluster to the right number of elements, the wire will be broken if it doesn't match.  I made and XNode to do this but didn't want to add another unknown into debugging this.

In Messenger Library, under the Utility sub pallet, I have an "Array of Variants to Cluster” VI that will dynamically handle the number of elements (up to 100).  Useful in reuse code where you don’t know the specific number of elements.

Link to comment
2 hours ago, drjdpowell said:

In Messenger Library, under the Utility sub pallet, I have an "Array of Variants to Cluster” VI that will dynamically handle the number of elements (up to 100).  Useful in reuse code where you don’t know the specific number of elements.

Yeah but what if you have more than 100 elements in a cluster...yeah...I'm not saying it won't happen, but if it does you probably have other issues that are more pressing.

Link to comment
10 minutes ago, hooovahh said:

Yeah but what if you have more than 100 elements in a cluster...yeah...I'm not saying it won't happen, but if it does you probably have other issues that are more pressing.

The technique works up to 255, but I have yet to summon the effort to do that many cases.

Link to comment
  • 4 weeks later...

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.