LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

External dll call memory leak

Hi,

 

My VI calls a function in a dll in a loop for a long period of time.

I've noticed that after couple of hours it starts loosing memory.

It seems like the LabViews consumption of memory stays constant but the System looses memory.

I've checked the dll in .Net application and I'm sure that there is no such a problem there.

 

This is how my VI is organized:

 

Call

 

 

 

0 Kudos
Message 1 of 5
(3,057 Views)

Can you add a bit more info, like how much memory is the system loosing. If LabVIEW isn't increasing RAM uasage, where do you see memory usage increases? For example, if you write a lot of data to disk, the system might buffer the data so you'll see an increase chached section of RAM in task manager. Also, when you close LabVIEW does that memory go down again, or does it stay at the increased level?

 

Also, overall, what is the dll supposed to do?

0 Kudos
Message 2 of 5
(3,056 Views)

The increase is more than 1G after couple of hours.

The dll reads a stream of 5000 points from a scope , these points are displayed on a waveform graph.

The reading procedure repeated in a loop for long period of time approximately 20 tpp.

The memory usage increase is the overall system increase and it happens only when the application is running.

The dll has been tested in an application written in c# .Net and its behaviour is perfect.

0 Kudos
Message 3 of 5
(3,054 Views)

Hi Eddie,

 

I'm not seeing anything in this screenshot that should be causing LabVIEW to lose memory.  It also looks to me like this is code that's being used in a subVI.  Is there something else going on in the application?  I'm wondering if there is that might be causing the memory leak you're experiencing.

 

Regards,

 

-Dave C

Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,031 Views)

I don't see anything either. But can you maybe post how the dll function is declared in it's header file (with all the macro definitions if any are used in the function prototype) as well as a screenshot of the NI prototype found in the "Call library function" node.

 

Can you also clarify if the RAM usage is again decreased once the application ends or if it stays at the increased level. In one case it's a memory leak while in the other case it might simply be that LabVIEW needs a lot of RAM to do whatever calculations you do with the data (although 1GB does seem like a lot).

 

Matt

0 Kudos
Message 5 of 5
(3,024 Views)