DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Leak with Private Events

I believe I have found a memory leak with Private Events in Cloneable (and possibly standard) Modules.

 

In the "Obtain SEQ.vi" that is called by the "Obtain Request Events.vi" the VI obtains a reference to a named queue that is not cleared out by the immediate call to the "Read SEQ.vi".

 

When the obtain queue function is called with a named queue "the function searches for an existing queue with the same name and returns a new reference to the existing queue". This is stated in the documentation for the "Obtain Queue Function". https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/obtain-queue.html

 

This reference should be cleared by the "Read SEQ.vi" that is called immediately after the "Obtain SEQ.vi". See below screenshot for my temporary fix to test my suspicion.

CGerspacher_0-1717426197028.png

This clears the memory and prevents the leak in my testing.

 

 

This leak was discovered by some testing I was doing that was calling many events (1,000,000+) and would eventually cause me to get to the point where I was unable to publish any events to the module as it would claim that a module was not running. My issues are no longer present after explicitly releasing the reference to the queue created by the "Obtain SEQ.vi". Unfortunately, I can't provide my exact code that was causing this issue, but if needed, I can try to replicate it with code that I am able to distribute.

0 Kudos
Message 1 of 5
(546 Views)

Thank you for bringing this issue to our attention and for providing a detailed description. I've assigned issue #931. We will investigate and report back here. In all honesty, it could take some time as all of us are very busy at the moment.




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )


0 Kudos
Message 2 of 5
(510 Views)

The error I was getting is Error Code 403684 Module Not Running. Posting this to potentially help others find it.

0 Kudos
Message 3 of 5
(450 Views)

In LabVIEW there is a hard limit of 2^20 live refnums of any one type, which is just more than a million.

0 Kudos
Message 4 of 5
(406 Views)

@CGerspacher, just to clarify, you mention in the title of this post that the memory leak is with Private Events, but DQMH private events do not use the SEQ to store references... only Local Instance Events for cloneable modules do that.

 

I just wanted to make sure you were reporting this bug in reference to using Local Instance Events, and not Private Events. Thanks!

0 Kudos
Message 5 of 5
(199 Views)