LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open Application Reference memory leak

I am trying to figure out why you would want to keep the reference open after LV has closed, but the reasoning escapes me.  Anyone care to explain?
0 Kudos
Message 11 of 16
(1,308 Views)

I was hoping I could get away without writting a book.

"Back the day..." LV would let you write pretty bad code. Amoung other things, if you allocated a serial port and failed to close it explicitly, LV would let you do that. This meant that if you want ed to use the same port again for another application, NO-GO! The serial port was still allocated. And trying to run your program again... same issue. You would have to re-boot.

LV has gotten a lot smarter over the years and now behaves like an efficient little assistant and keeps track of what you are doing a cleans up after for you.

Since resource allocation is very expensive (performance wise) LV allocates and releases resources only when it has to or there is no possiblitiy of trying to get at it again. This means that the resource are de-allocated when LV exits.

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 12 of 16
(1,302 Views)
Ahhh.  I read that as "is not released after you exit LV" instead of "is not released until after you exit LV".

My mistake.  Thank you for the summary. Robot Very Happy
0 Kudos
Message 13 of 16
(1,292 Views)
You are welcome.
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 16
(1,288 Views)
The little exemple from my first post SHOULD release memory, hence the explicit closing function.
And it does on every computer I tested.. except my development system !

That's the point I would like to understand.

Matthieu
0 Kudos
Message 15 of 16
(1,281 Views)
Ahh ! Smiley Happy

That is the good question.

First, I have a acquisition vi, that acquires and process continuously ultrasonic data (we provide ultrasonic systems, including electronic pulser/receivers, and digitalization boards). Results are stored in a Global Variable vi. This is released as a Labview executable.

Our customer needs to get the results stored in the Global Variable vi from their own program, and possibly from a separated computer. I give them one Labview DLL. Enclosed in it are one configuration vi (ip adress, and port on which the acquisition part is running) and some accessor functions (get results).

The problem is that I do not know how to store an Application reference between calls to my DLL : I have to open it on each result reading. Because Labview automatically closes the reference if the enclosing vi stops.

This part of the problem is now solved : I was not closing all references correctly on each result reading. That is why my customer detected a memory leak.

The other part, which is separated, and still annoys me is that this works on every computer I had access to, except in mine ! Ever after a HUGE cleaning.

Thanks for your interest

Salutations

Matthieu
0 Kudos
Message 16 of 16
(1,274 Views)