LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Overflowing

Solved!
Go to solution

The lower "Waveform Array" on the ARB Channel node can be used to close the reference.  This returns the object once the property node has finished working on it.

0 Kudos
Message 11 of 19
(2,104 Views)

I have some good news and some bad news.

 

Good news first: I have narrowed the problem down to the following marked part of the VI. It is at the expected part of the "WaveformStruct" Object. There the created Labview Array is converted into the .NET object array and sent to the device.

labview_memory_leak_3.PNG

 

 

The bad news is that adding 'Close reference' did not resolve the problem of the memory overflow.

 

Is there anything else I can do at this part to resolve this issue?

0 Kudos
Message 12 of 19
(2,086 Views)

Does the reference offer a destroy method?

0 Kudos
Message 13 of 19
(2,080 Views)

I am not sure if it does.

There is limited information about the objects and classes. But I have a small documentation about which reads the following:

library.PNG

 

 

 

0 Kudos
Message 14 of 19
(2,077 Views)
Solution
Accepted by QU-1

@QU-1 wrote:

labview_memory_leak_3.PNG

 


The Error out and Error descriptions should be Local variables. The Error out should be wired through the other nodes and Close ref's so you don't close e.g. ARBChannel before ATError. Why do you create a new WaveformStruct each time? I think this is the biggest cultprit and it isn't closed! (Corrections, it's closed on the output side which is probably the same, but are you sure? Probe the arrays and check the references) Create it on 1st call then reuse it, it should also improve performance some. Also, i think it's better to simply use a Build Array on the reference to the Waveforms input.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 19
(2,070 Views)
I would like to create the WaveformStruct on 1st call then reuse it. But how do i manage this? I have written the VI so that it is called from my main VI and executes in the Flat Sequence Structure every time it is called.
0 Kudos
Message 16 of 19
(2,058 Views)

You'll use the First Call primitive, a Case with the constructor in True , and a feedback node that reuses it in False. 🙂

In this case you probably don't want to close it, as you'll want it to stay alive until next time.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 17 of 19
(2,042 Views)

It seems like I have found the solution now. It was indeed the empty .NET array as seen in the red marked part in the picture above.

 

However creating a 'First Call primitive' was giving me an error at the VI execution.

Therefore I created the .NET variables (WafevormStruct and the empty array) in my main VI and fed them into the subVI. The main VI is running continously but creates those variables only on the first run.

 

What I still can not understand is why the 'Close Reference' call did not work properly. I thought this should have solved the problem as well.

Message 18 of 19
(2,015 Views)

I bet someone will correct me, but LV don't forcibly close the refs, if it suspects it's used it'll wait. I've had the same thing happen to me, by opening .net refs it basically 'leaked' 4 bytes each time. After a while things crashed as it was only allowed to open 1 million of them. ^^

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 19
(2,006 Views)