LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RAM Problem

Greetings, I am having a problem with my vi. When I run the vi I can see under windows task manager that the memory usages increases at 500 kb/s . I have two sub vi's in a while loop and i'm not storing data anywhere. Any ideas?
0 Kudos
Message 1 of 9
(3,515 Views)
Well, it must be allocating memory, so you must be doing something related to memory allocation, like creating arrays or concatenating strings. Why don't you post your VIs so we can better tell...
Message 2 of 9
(3,502 Views)

While loops with no delay cause a race condition that consumes RAM

try adding a small delay in your while loop

use the wait(ms) vi  even a 1 ms delay will improve performance

 

- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 3 of 9
(3,479 Views)
"While loops with no delay cause a race condition that consumes RAM"
 
Huh? Since when? This makes no sense. Yeah, it will chew up your CPU time, but it doesn't chew up your RAM. This loop:

certainly doesn't have an effect on RAM. Pegs the CPU real nice, though. Smiley Wink

Do you have an actual example that does this?

Message Edited by smercurio_fc on 08-15-2007 03:13 PM

Message Edited by smercurio_fc on 08-15-2007 03:14 PM

0 Kudos
Message 4 of 9
(3,473 Views)
Hi, nope no arrays or string canconecations... Problem was I was calling DAQmx create task over and over again in my while loop but never canceling the task. So, even though I didn't think I was storing data I was actually taking a snapshot and keeping it in RAM every time the create task vi was called. Thanks for your input.
0 Kudos
Message 5 of 9
(3,451 Views)

Hi,

 

I am sorry but I don't know how to create a new discussion. That's why i am trying to solve it by this way. I also have a RAM consumption problem. Is there any possiblity to find the RAM consumer? I would like to know the RAM consumption in detail, like for the constant A x kB and for the 2-dimensional array M y kB and for the writing process z kB.

0 Kudos
Message 6 of 9
(2,878 Views)

Please go through the Quick intro to start using the forum.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 9
(2,872 Views)

@dqp wrote:

Hi,

 

I am sorry but I don't know how to create a new discussion. That's why i am trying to solve it by this way. I also have a RAM consumption problem. Is there any possiblity to find the RAM consumer? I would like to know the RAM consumption in detail, like for the constant A x kB and for the 2-dimensional array M y kB and for the writing process z kB.


Tools -> Performance -> VIs and memory

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 9
(2,841 Views)

dqp wrote:

I am sorry but I don't know how to create a new discussion. That's why i am trying to solve it by this way. I also have a RAM consumption problem. Is there any possiblity to find the RAM consumer? I would like to know the RAM consumption in detail, like for the constant A x kB and for the 2-dimensional array M y kB and for the writing process z kB.


Please try to start a new discussion following the instructions by P@Anand.

 

The RAM consumption for arrays can be easily calculated from the number of elements in the array and the datatype of the elements. In addition, arrays need to be contiguous in memory, meaning that constantly resizing arrays in memory will cause frequence reallocations and memory fragmentation, at which time you might not have enough contiguous ram left. You can run out of memory earlier than you think. Remember that indicators and transfer buffers contain additional datacopies. Overuse of local variables and value property nodes can force additional copies in memory and should thus be avoided.

 

There are many programming tools that can accumulate evergrowing data forever and can thus cause memory issues (building array in shift registers, build xy graph express VI configured to retain data, etc. etc.)

 

Profiling gives you the memory use of each subVI and might not point out the data structure that is responsible. It would be easiest if you could post your VI. A lot of experts here in the forum can probably point out memory inefficient code very quickly by just looking at it.

 

If you have the execution trace toolkit, that caould also help analyze memory issues.

 

In summary:

  • Start a new discussion
  • Attach your VI
  • Explain what kind of memory problems you are having.
0 Kudos
Message 9 of 9
(2,821 Views)