LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build array out of memory


@stevem181 wrote:

If the producer loop is complete (and therefore no longer producing data), how can data be lost?


Ther could still be a lot of data in the queue that has not been seen by the consumer loop.

0 Kudos
Message 21 of 28
(1,175 Views)

@brian19876 wrote:

Looks alot better and more simple than my layout but if i run this program i sent you after a hour i will use 250mb more ram and after 6-8 will get out of memory that why i was asking if you seen any where there could be a memory leak. Its driving me crazy


We still need to see all subVIs.

 

For example are you constantly opening new visa sessions without ever closing them?

Message 22 of 28
(1,173 Views)

stevem181,

 

It the producer loop is stopped when complete, it is very likely that the queue will be released before all the data has been removed and processed by the consumer. The queue will probalby be released in microseconds while a consumer with file writes aill almost certainly take milliseconds. In almost all real applications sending some kind of definite indication that everything is done is more reliable than stopping on a released queue.

 

brian19876,

 

There is nothing obvious in the parts of the code you have posted so far that would consume hundreds of MB of RAM. Your files will certainly get that big.  You have 38 elements in the header array. You then write data at 100 records per second. If each data element requires on average 10 characters, the file size becomes 38*10*100*3600 = 136.8 MB/hour.  If your subVIs are accumulating that data, you could run out of memory.

 

Show us all the subVIs.

 

Lynn

0 Kudos
Message 23 of 28
(1,162 Views)

Well my memory leak is coming from non page pool kernel memory narrowed it down to hardware driver for my inferred communication dongles. Do thing opening and closing visa sessions too quickly can cause this to happen?

0 Kudos
Message 24 of 28
(1,107 Views)

We should see what is going on inside those subVIs.  Just the fact that you had to ask that question is worrisome.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 25 of 28
(1,101 Views)

if i open send message get a message back and close and repeat this every 5-7 seconds could this cause the memory leak im seeing

0 Kudos
Message 26 of 28
(1,095 Views)

@brian19876 wrote:

Well my memory leak is coming from non page pool kernel memory narrowed it down to hardware driver for my inferred communication dongles. Do thing opening and closing visa sessions too quickly can cause this to happen?


Yes. You should only open the session once at the start and close it when you exit the program. Opening lots of sessions is a known cause of memory growth. (Not really a bug, a session takes some memory and while the program is running it's considered active and the memory manager cant release it)

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 27 of 28
(1,085 Views)

Constantly opening and closing the port also slows things down.  As was said, you should open the reference at the beginning of your program and close it at the end.  You can do the read and write as much as you want inside then.  It makes things simpler and a lot more efficient (performance and memory wise).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 28 of 28
(1,073 Views)