02-09-2018 08:45 AM - edited 02-09-2018 08:47 AM
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.
02-09-2018 09:14 AM
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
02-09-2018 09:44 AM - edited 02-09-2018 09:44 AM
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?
02-09-2018 12:18 PM
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
02-09-2018 12:57 PM
OK 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
02-13-2018 03:39 AM - edited 02-13-2018 03:44 AM
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?
02-13-2018 09:59 AM
Sorry I can not help further.
I will have to let NI support investigate the leaks.
Ben