LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D Plot (Waterfall) in dynamically loaded VIs results in reference leak

Hi,

 

I'm using a 3D Watefall in a dynamically loaded VI (a dialog showing the 3D Waterfall). The VI is loaded using the "Start Asynchronous Call.vi". It all work fine. I can open multiple dialogs with the 3D Watefall and close them. (see the screen 3d_ref_leak_01.png). This is the only part of the code that touches the 3D plot.

However, when I close the dialog (the subVI with the 3D Waterfall in it), the LabVIEW Desktop Execution Trace Toolikt returns 85 reference leak messages. (see attached screens). Is it really a reference leak? Am I loosing memory?


Using LabVIEW 2017 32 bit on Windows 10.

Download All
0 Kudos
Message 1 of 7
(3,566 Views)

I would guess yes... unless they fixed what I saw way-back...

 

I had to come up with a scheme where the plot was re-used.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 7
(3,548 Views)

OK. So the solution would be to store the plot object (actually an array of objects) in the main application, and pass it to the dynamically loaded VIs? Am I reading this correctly?

0 Kudos
Message 3 of 7
(3,543 Views)

wrote:

OK. So the solution would be to store the plot object (actually an array of objects) in the main application, and pass it to the dynamically loaded VIs? Am I reading this correctly?


That would depend on some details...

 

In my case I used and Action Engine to do all of the interaction with the Plot. The Action Engine could work without "forking" wires. The Forking will duplicate the data in the wire.

 

Not sure if that helps at all...

 

Ben   

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(3,528 Views)

proj.jpgOK to correct my previous...

 

I was not doing a waterfall plot but developing a 3D Viewer that was able to use C-Scan info from an ultrasonic inspection to illustrate where in a railroad wheel a flaw was detected along with an indication of the size and nature of the reflected signal.

 

 

 

I kept all of the objects in a Shift Register of the main VI and passed an object wire (that in turn contained many other object instances) to Methods to use the display as I needed. That got me so far and then I discovered that using a factory pattern to spit out instances of the objects I needed resulted in even more resources being allocated each time I started over from scratch. Just tossing the object instances left them as allocated resources.

 

In the end I changed the code to NOT toss instances of objects but rather re-use the previously allocated instances. Think of a "Resource Pool" but objects instead. I only allocated more instances when a new plot request demanded more than what was already allocated.

 

Ben

 

Cscan_OnSurface_CleanedUp.JPG

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 7
(3,524 Views)

Thanks Ben for your reply,

So I made a Functional Global with a repository of objects, that are given to the the Dialog SubVi and are returned to the repository when the dialog is about to be closed. Objects that are taken are flagged as "taken", and flagged as "not taken" when returned. This however gives the same reference leaks when viewed in the Trace Toolkit.

See the attached VI.

Am I missing here something?

0 Kudos
Message 6 of 7
(3,483 Views)

Sorry I can not help further.

 

I will have to let NI support investigate the leaks.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(3,469 Views)