Reference Leaks Appearing in LabVIEW Desktop Execution Trace Toolkit When Using NI-XNET Database API

Updated Jun 4, 2021

Reported In



Issue Details

I'm running a program which calls functions from the NI-XNET Database API, and am running the LabVIEW™  Desktop Execution Trace Toolkit (DETT) to debug and optimize my code. I noticed that, while my code is executing correctly, reference leaks are being reported in the DETT when these functions are called like what is shown in the image below. Is this behavior negatively impacting my code, and what can I do to resolve it?


These reference leaks are caused whenever a VI or subVI creates a reference that isn't manually closed before the top-level VI finishes executing. If you're running a single VI, then it runs as the de-facto top-level VI, causing these reference leaks to be reported for all functions which require references in your code. This behavior is expected, and if it's not negatively impacting the operation of your code you don't need to be concerned about these reference leaks.

If the behavior is negatively impacting your code, or you would otherwise like to resolve it, you can do so by creating a top-level VI which calls your current code as a subVI. Pass your code, now represented by a subVI on your new top-level VI, your initial XNET reference, and pass this reference out to an instance of XNET Database before your top-level VI finishes execution. An example of what this might look like is shown below. Note that a False constant is passed to the Close All? input on the Database Close VI - this is done to ensure that the references used during your code's operation are all manually closed.